zvtvz / zvt Goto Github PK
View Code? Open in Web Editor NEWmodular quant framework.
Home Page: https://zvt.readthedocs.io/en/latest/
License: MIT License
modular quant framework.
Home Page: https://zvt.readthedocs.io/en/latest/
License: MIT License
我更新了最新的数据之后,发现东财的年报数据更新不全, 目前我手上的数据量,不到800只股票有19年的年报,一季度的数据量更少。
看了数据更新日志,不少获取 不到数据的。
大概类似这样的
could not get data for nested_fields:['GaoGuanZengJianList']
因此,我想问一下,能否提供一下最新的db数据放到百度盘,提供下载?
zvt主要做以下事情,这些事情是有先后顺序且配合紧密的:
数据
计算
文档待完善
回测
目前是只保存前复权数据,当数据变动时,在on_finish_entity里面把之前的数据按最新的factor计算,这里有一个问题,on_finish_entity可能在全部抓完后才回调,可能出现用最后entity的factor计算其他entity的错误。
建议计算逻辑直接放在抓取后
建议保存后复权数据,因为后面factor的计算如果用qfq,当数据变动,也需要重新计算,有时作回测hfq是个好选择
提个小建议,example可否拿到zvt的外面,单独搞个文件夹,跟tests同级
版本0.7.0
In [1]: from zvt.domain import *
In [2]: Stock.provider_map_recorder
Out[2]:
{'joinquant': zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder,
'exchange': zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder,
'eastmoney': zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder}
In [3]: Stock.record_data(provider='exchange')
Stock registered recorders:{'joinquant': <class 'zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder'>, 'exchange': <class 'zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder'>, 'eastmoney': <class 'zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder'>}
Empty DataFrame
Columns: [code, name, list_date]
Index: []
INFO MainThread 2020-01-21 11:33:56,402 ExchangeChinaStockListRecorder:china_stock_list_spider.py:63 download_stock_list code name list_date exchange entity_type id entity_id timestamp
1492 603995 甬金股份 2019-12-24 sh stock stock_sh_603995 stock_sh_603995 2019-12-24
1493 603996 ST中新 2015-12-22 sh stock stock_sh_603996 stock_sh_603996 2015-12-22
1494 603997 继峰股份 2015-03-02 sh stock stock_sh_603997 stock_sh_603997 2015-03-02
1495 603998 方盛制药 2014-12-05 sh stock stock_sh_603998 stock_sh_603998 2014-12-05
1496 603999 读者传媒 2015-12-10 sh stock stock_sh_603999 stock_sh_603999 2015-12-10
INFO MainThread 2020-01-21 11:33:56,416 ExchangeChinaStockListRecorder:china_stock_list_spider.py:64 download_stock_list persist stock list successs
Empty DataFrame
Columns: [code, name, list_date]
Index: []
INFO MainThread 2020-01-21 11:33:57,883 ExchangeChinaStockListRecorder:china_stock_list_spider.py:63 download_stock_list code name list_date exchange entity_type id entity_id timestamp
2193 300809 华辰装备 2019-12-04 sz stock stock_sz_300809 stock_sz_300809 2019-12-04
2194 300810 中科海讯 2019-12-06 sz stock stock_sz_300810 stock_sz_300810 2019-12-06
2195 300811 铂科新材 2019-12-30 sz stock stock_sz_300811 stock_sz_300811 2019-12-30
2196 300812 易天股份 2020-01-09 sz stock stock_sz_300812 stock_sz_300812 2020-01-09
2197 300813 泰林生物 2020-01-14 sz stock stock_sz_300813 stock_sz_300813 2020-01-14
INFO MainThread 2020-01-21 11:33:57,896 ExchangeChinaStockListRecorder:china_stock_list_spider.py:64 download_stock_list persist stock list successs
In [4]: Stock.record_data(provider='joinquant')
Stock registered recorders:{'joinquant': <class 'zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder'>, 'exchange': <class 'zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder'>, 'eastmoney': <class 'zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder'>}
auth success ( 如需说明文档请查看:https://url.cn/5oB7EOO,更多问题请联系JQData管理员,微信号:JQData02 )
INFO MainThread 2020-01-21 11:34:05,015 JqChinaStockRecorder:china_stock_meta_recorder.py:54 run entity_id display_name name timestamp end_date type list_date id entity_type exchange code
0 stock_sz_000001 平安银行 平安银行 1991-04-03 2200-01-01 stock 1991-04-03 stock_sz_000001 stock sz 000001
1 stock_sz_000002 万科A 万科A 1991-01-29 2200-01-01 stock 1991-01-29 stock_sz_000002 stock sz 000002
2 stock_sz_000004 国农科技 国农科技 1990-12-01 2200-01-01 stock 1990-12-01 stock_sz_000004 stock sz 000004
3 stock_sz_000005 世纪星源 世纪星源 1990-12-10 2200-01-01 stock 1990-12-10 stock_sz_000005 stock sz 000005
4 stock_sz_000006 深振业A 深振业A 1992-04-27 2200-01-01 stock 1992-04-27 stock_sz_000006 stock sz 000006
5 stock_sz_000007 全新好 全新好 1992-04-13 2200-01-01 stock 1992-04-13 stock_sz_000007 stock sz 000007
6 stock_sz_000008 神州高铁 神州高铁 1992-05-07 2200-01-01 stock 1992-05-07 stock_sz_000008 stock sz 000008
7 stock_sz_000009 **宝安 **宝安 1991-06-25 2200-01-01 stock 1991-06-25 stock_sz_000009 stock sz 000009
8 stock_sz_000010 *ST美丽 *ST美丽 1995-10-27 2200-01-01 stock 1995-10-27 stock_sz_000010 stock sz 000010
9 stock_sz_000011 深物业A 深物业A 1992-03-30 2200-01-01 stock 1992-03-30 stock_sz_000011 stock sz 000011
10 stock_sz_000012 南玻A 南玻A 1992-02-28 2200-01-01 stock 1992-02-28 stock_sz_000012 stock sz 000012
11 stock_sz_000014 沙河股份 沙河股份 1992-06-02 2200-01-01 stock 1992-06-02 stock_sz_000014 stock sz 000014
12 stock_sz_000016 深康佳A 深康佳A 1992-03-27 2200-01-01 stock 1992-03-27 stock_sz_000016 stock sz 000016
13 stock_sz_000017 深中华A 深中华A 1992-03-31 2200-01-01 stock 1992-03-31 stock_sz_000017 stock sz 000017
14 stock_sz_000018 神城A退 神城A退 1992-06-16 2020-01-06 stock 1992-06-16 stock_sz_000018 stock sz 000018
15 stock_sz_000019 深粮控股 深粮控股 1992-10-12 2200-01-01 stock 1992-10-12 stock_sz_000019 stock sz 000019
16 stock_sz_000020 深华发A 深华发A 1992-04-28 2200-01-01 stock 1992-04-28 stock_sz_000020 stock sz 000020
17 stock_sz_000021 深科技 深科技 1994-02-02 2200-01-01 stock 1994-02-02 stock_sz_000021 stock sz 000021
18 stock_sz_000022 深赤湾A 深赤湾A 1993-05-05 2018-12-25 stock 1993-05-05 stock_sz_000022 stock sz 000022
19 stock_sz_000023 深天地A 深天地A 1993-04-29 2200-01-01 stock 1993-04-29 stock_sz_000023 stock sz 000023
20 stock_sz_000024 招商地产 招商地产 1993-06-07 2015-12-29 stock 1993-06-07 stock_sz_000024 stock sz 000024
21 stock_sz_000025 特力A 特力A 1993-06-21 2200-01-01 stock 1993-06-21 stock_sz_000025 stock sz 000025
22 stock_sz_000026 飞亚达 飞亚达 1993-06-03 2200-01-01 stock 1993-06-03 stock_sz_000026 stock sz 000026
23 stock_sz_000027 深圳能源 深圳能源 1993-09-03 2200-01-01 stock 1993-09-03 stock_sz_000027 stock sz 000027
24 stock_sz_000028 国药一致 国药一致 1993-08-09 2200-01-01 stock 1993-08-09 stock_sz_000028 stock sz 000028
25 stock_sz_000029 深深房A 深深房A 1993-09-15 2200-01-01 stock 1993-09-15 stock_sz_000029 stock sz 000029
26 stock_sz_000030 富奥股份 富奥股份 1993-09-29 2200-01-01 stock 1993-09-29 stock_sz_000030 stock sz 000030
27 stock_sz_000031 大悦城 大悦城 1993-10-08 2200-01-01 stock 1993-10-08 stock_sz_000031 stock sz 000031
28 stock_sz_000032 深桑达A 深桑达A 1993-10-28 2200-01-01 stock 1993-10-28 stock_sz_000032 stock sz 000032
29 stock_sz_000033 新都退 新都退 1994-01-03 2017-07-06 stock 1994-01-03 stock_sz_000033 stock sz 000033
... ... ... ... ... ... ... ... ... ... ... ...
3830 stock_sh_688139 海尔生物 海尔生物 2019-10-25 2200-01-01 stock 2019-10-25 stock_sh_688139 stock sh 688139
3831 stock_sh_688158 优刻得 优刻得 2020-01-20 2200-01-01 stock 2020-01-20 stock_sh_688158 stock sh 688158
3832 stock_sh_688166 博瑞医药 博瑞医药 2019-11-08 2200-01-01 stock 2019-11-08 stock_sh_688166 stock sh 688166
3833 stock_sh_688168 安博通 安博通 2019-09-06 2200-01-01 stock 2019-09-06 stock_sh_688168 stock sh 688168
3834 stock_sh_688178 万德斯 万德斯 2020-01-14 2200-01-01 stock 2020-01-14 stock_sh_688178 stock sh 688178
3835 stock_sh_688181 八亿时空 八亿时空 2020-01-06 2200-01-01 stock 2020-01-06 stock_sh_688181 stock sh 688181
3836 stock_sh_688188 柏楚电子 柏楚电子 2019-08-08 2200-01-01 stock 2019-08-08 stock_sh_688188 stock sh 688188
3837 stock_sh_688196 卓越新能 卓越新能 2019-11-21 2200-01-01 stock 2019-11-21 stock_sh_688196 stock sh 688196
3838 stock_sh_688198 佰仁医疗 佰仁医疗 2019-12-09 2200-01-01 stock 2019-12-09 stock_sh_688198 stock sh 688198
3839 stock_sh_688199 久日新材 久日新材 2019-11-05 2200-01-01 stock 2019-11-05 stock_sh_688199 stock sh 688199
3840 stock_sh_688202 美迪西 美迪西 2019-11-05 2200-01-01 stock 2019-11-05 stock_sh_688202 stock sh 688202
3841 stock_sh_688218 江苏北人 江苏北人 2019-12-11 2200-01-01 stock 2019-12-11 stock_sh_688218 stock sh 688218
3842 stock_sh_688258 卓易信息 卓易信息 2019-12-09 2200-01-01 stock 2019-12-09 stock_sh_688258 stock sh 688258
3843 stock_sh_688268 华特气体 华特气体 2019-12-26 2200-01-01 stock 2019-12-26 stock_sh_688268 stock sh 688268
3844 stock_sh_688278 特宝生物 特宝生物 2020-01-17 2200-01-01 stock 2020-01-17 stock_sh_688278 stock sh 688278
3845 stock_sh_688288 鸿泉物联 鸿泉物联 2019-11-06 2200-01-01 stock 2019-11-06 stock_sh_688288 stock sh 688288
3846 stock_sh_688299 长阳科技 长阳科技 2019-11-06 2200-01-01 stock 2019-11-06 stock_sh_688299 stock sh 688299
3847 stock_sh_688300 联瑞新材 联瑞新材 2019-11-15 2200-01-01 stock 2019-11-15 stock_sh_688300 stock sh 688300
3848 stock_sh_688310 迈得医疗 迈得医疗 2019-12-03 2200-01-01 stock 2019-12-03 stock_sh_688310 stock sh 688310
3849 stock_sh_688321 微芯生物 微芯生物 2019-08-12 2200-01-01 stock 2019-08-12 stock_sh_688321 stock sh 688321
3850 stock_sh_688333 铂力特 铂力特 2019-07-22 2200-01-01 stock 2019-07-22 stock_sh_688333 stock sh 688333
3851 stock_sh_688357 建龙微纳 建龙微纳 2019-12-04 2200-01-01 stock 2019-12-04 stock_sh_688357 stock sh 688357
3852 stock_sh_688358 祥生医疗 祥生医疗 2019-12-03 2200-01-01 stock 2019-12-03 stock_sh_688358 stock sh 688358
3853 stock_sh_688363 华熙生物 华熙生物 2019-11-06 2200-01-01 stock 2019-11-06 stock_sh_688363 stock sh 688363
3854 stock_sh_688366 昊海生科 昊海生科 2019-10-30 2200-01-01 stock 2019-10-30 stock_sh_688366 stock sh 688366
3855 stock_sh_688368 晶丰明源 晶丰明源 2019-10-14 2200-01-01 stock 2019-10-14 stock_sh_688368 stock sh 688368
3856 stock_sh_688369 致远互联 致远互联 2019-10-31 2200-01-01 stock 2019-10-31 stock_sh_688369 stock sh 688369
3857 stock_sh_688388 嘉元科技 嘉元科技 2019-07-22 2200-01-01 stock 2019-07-22 stock_sh_688388 stock sh 688388
3858 stock_sh_688389 普门科技 普门科技 2019-11-05 2200-01-01 stock 2019-11-05 stock_sh_688389 stock sh 688389
3859 stock_sh_688399 硕世生物 硕世生物 2019-12-05 2200-01-01 stock 2019-12-05 stock_sh_688399 stock sh 688399
[3860 rows x 11 columns]
INFO MainThread 2020-01-21 11:34:05,058 JqChinaStockRecorder:china_stock_meta_recorder.py:55 run persist stock list success
已退出
In [5]: df=Stock.query_data(provider='eastmoney')
In [6]: len(df)
Out[6]: 3695
In [7]: df=Stock.query_data(provider='joinquant')
In [8]: len(df)
Out[8]: 3860
聚宽的有科创板数据,需要对ExchangeChinaStockListRecorder增强一下。
class HkHolder(HolderBase, Mixin):
__tablename__ = 'hk_holder'
# 股票代码
code = Column(String(length=32))
# 股票名称
name = Column(String(length=32))
# 市场通编码 三种类型:310001-沪股通,310002-深股通,310005-港股通
holder_code = Column(String(length=32))
# 市场通名称 三种类型:沪股通,深股通,港股通
holder_name = Column(String(length=32))
# 持股数量
share_number = Column(Float)
# 持股比例
share_ratio = Column(Float)
下载数据
from zvt.domain import *
HkHolder.record_data(provider='joinquant')
使用例子,最新的持仓比例前50
In [13]: df=HkHolder.query_data(start_timestamp='2020-08-07',order=HkHolder.share_ratio.desc(),limit=50,provider='joinquant',columns=['code','name','share_ratio'])
In [14]: df
Out[14]:
code name share_ratio timestamp
0 600009 上海机场 22.99 2020-08-07
1 603489 八方股份 22.97 2020-08-07
2 603501 韦尔股份 22.16 2020-08-07
3 002572 索菲亚 20.07 2020-08-07
4 300012 华测检测 19.93 2020-08-07
5 600201 生物股份 18.01 2020-08-07
6 601901 方正证券 17.87 2020-08-07
7 000333 美的集团 16.75 2020-08-07
8 603605 珀莱雅 16.48 2020-08-07
9 000651 格力电器 16.35 2020-08-07
10 300347 泰格医药 15.78 2020-08-07
11 600406 国电南瑞 15.71 2020-08-07
12 002008 大族激光 14.73 2020-08-07
13 002439 启明星辰 14.61 2020-08-07
14 002508 老板电器 14.14 2020-08-07
15 600887 伊利股份 12.97 2020-08-07
16 601138 工业富联 12.94 2020-08-07
17 600298 安琪酵母 12.90 2020-08-07
18 000338 潍柴动力 12.77 2020-08-07
19 603882 金域医学 12.60 2020-08-07
20 603259 药明康得 12.36 2020-08-07
21 603939 益丰药房 12.23 2020-08-07
22 002271 东方雨虹 11.68 2020-08-07
23 600276 恒瑞医药 11.53 2020-08-07
24 002557 洽洽食品 11.48 2020-08-07
25 300124 汇川技术 11.44 2020-08-07
26 600585 海螺水泥 11.31 2020-08-07
27 600872 中炬高新 11.31 2020-08-07
28 000157 中联重科 11.09 2020-08-07
29 300244 迪安诊断 11.08 2020-08-07
30 600885 宏发股份 10.86 2020-08-07
31 601888 **国旅 10.82 2020-08-07
32 002410 广联达 10.38 2020-08-07
33 600660 福耀玻璃 10.37 2020-08-07
34 300285 国瓷材料 10.22 2020-08-07
35 603713 密尔克卫 10.04 2020-08-07
36 601100 恒立液压 9.90 2020-08-07
37 600031 三一重工 9.86 2020-08-07
38 600690 海尔智家 9.73 2020-08-07
39 300383 光环新网 9.57 2020-08-07
40 603915 国茂股份 9.30 2020-08-07
41 002179 中航光电 9.15 2020-08-07
42 603056 德邦股份 9.02 2020-08-07
43 002027 分众传媒 8.87 2020-08-07
44 002697 红旗连锁 8.64 2020-08-07
45 603533 掌阅科技 8.51 2020-08-07
46 600066 宇通客车 8.45 2020-08-07
47 600519 贵州茅台 8.30 2020-08-07
48 600835 上海机电 8.30 2020-08-07
49 603737 三棵树 8.28 2020-08-07
In [2]: BlockMoneyFlow.record_data(codes=['gn_jght'])
BlockMoneyFlow registered recorders:{'sina': <class 'zvt.recorders.sina.money_flow.sina_block_money_flow_recorder.SinaBlockMoneyFlowRecorder'>}
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-3b3704d6ea6e> in <module>
----> 1 BlockMoneyFlow.record_data(codes=['gn_jght'])
~/workspace/github/zvtvz/zvt/zvdata/__init__.py in record_data(cls, provider_index, provider, exchanges, entity_ids, codes, batch_size, force_update, sleeping_time, default_size, real_time, fix_duplicate_way, start_timestamp, end_timestamp, close_hour, close_minute)
232 # 2)the table of schema with IntervalLevel format is {entity}_{level}_{event}
233 table: str = cls.__tablename__
--> 234 level = IntervalLevel(table.split('_')[1])
235 r = recorder_class(exchanges=exchanges, entity_ids=entity_ids, codes=codes, batch_size=batch_size,
236 force_update=force_update, sleeping_time=sleeping_time, default_size=default_size,
~/workspace/github/zvtvz/zvt/ve/lib/python3.6/enum.py in __call__(cls, value, names, module, qualname, type, start)
289 """
290 if names is None: # simple value lookup
--> 291 return cls.__new__(cls, value)
292 # otherwise, functional API: we're creating a new Enum type
293 return cls._create_(value, names, module=module, qualname=qualname, type=type, start=start)
~/workspace/github/zvtvz/zvt/ve/lib/python3.6/enum.py in __new__(cls, value)
531 return member
532 # still not found -- try _missing_ hook
--> 533 return cls._missing_(value)
534
535 def _generate_next_value_(name, start, count, last_values):
~/workspace/github/zvtvz/zvt/ve/lib/python3.6/enum.py in _missing_(cls, value)
544 @classmethod
545 def _missing_(cls, value):
--> 546 raise ValueError("%r is not a valid %s" % (value, cls.__name__))
547
548 def __repr__(self):
ValueError: 'money' is not a valid IntervalLevel
直接使用SinaBlockMoneyFlowRecorder可以,应该是代理的构造函数的问题
git clone https://github.com/zvtvz/zvt.git
from zvt.apps import trader_app
ModuleNotFoundError: No module named 'zvt.apps'
用于过滤不同级别的行情
Traceback (most recent call last):
File "/home/devis/2.OutlierAnalysis/zvt/zvdata/recorder.py", line 342, in run
domain_item = self.generate_domain(entity_item, original_item)
File "/home/devis/2.OutlierAnalysis/zvt/zvdata/recorder.py", line 242, in generate_domain
entity_id=entity.id, filters=[self.data_schema.id == the_id], return_type='domain')
File "/home/devis/2.OutlierAnalysis/zvt/zvdata/api.py", line 115, in get_data
return query.all()
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 2843, in all
return list(self)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 2995, in iter
return self._execute_and_instances(context)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3016, in _execute_and_instances
close_with_result=True)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3025, in _get_bind_args
**kw
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3007, in _connection_from_session
conn = self.session.connection(**kw)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1046, in connection
execution_options=execution_options)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1051, in _connection_for_bind
engine, execution_options)
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 388, in _connection_for_bind
self._assert_active()
File "/home/devis/2.OutlierAnalysis/zvt/ve/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 264, in _assert_active
"This session is in 'prepared' state; no further "
sqlalchemy.exc.InvalidRequestError: This session is in 'prepared' state; no further SQL can be emitted within this transaction.
个人怀疑,跟session的状态有关。我现在的做法是恢复之前的异常捕捉代码。
更新东方财富时报这个错误,请问怎么解决?
2020-07-02 15:29:45,843 INFO MainThread run to 2213/3758
2020-07-02 15:29:46,014 INFO MainThread entity_id:stock_sz_300813,evaluate_start_end_size_timestamps result:None,None,2,None
2020-07-02 15:29:46,014 INFO MainThread sleeping 5 seconds
2020-07-02 15:30:01,188 ERROR MainThread code:200,content:�V
J-.�)Q��+���Q
.I,)-V��5400�Q�M-.NLOU�Rz��������>�_�bC��)+�.��b�R%%����"ϼ�|%�j�J����J�f90�@l�ĒD
������\=���������b=�ԼԢ�d=�L�@bQe�Q4T]pIQf^�
/V�����_�
Traceback (most recent call last):
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
origin_result = resp.json().get('Result')
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2020-07-02 15:30:01,190 ERROR MainThread recording data for entity_id:stock_sz_300813,<class 'zvt.domain.fundamental.dividend_financing.DividendFinancing'>,error:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 400, in run
timestamps=timestamps)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 136, in record
path_fields=self.path_fields)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 104, in request
return call_eastmoney_api(url=url, method=method, param=param, path_fields=path_fields)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 78, in call_eastmoney_api
raise e
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
origin_result = resp.json().get('Result')
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2020-07-02 15:30:22,182 ERROR MainThread eastmoney runner2 error:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "examples/recorders/eastmoney_data_runner2.py", line 24, in run
DividendFinancing.record_data(provider='eastmoney')
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/schema.py", line 152, in record_data
r.run()
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 481, in run
raise raising_exception
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 400, in run
timestamps=timestamps)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 136, in record
path_fields=self.path_fields)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 104, in request
return call_eastmoney_api(url=url, method=method, param=param, path_fields=path_fields)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 78, in call_eastmoney_api
raise e
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
origin_result = resp.json().get('Result')
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
如题
从百度网盘下载数据库,然后替换data文件夹中默认的,执行下面命令,
import os
from zvt.api import *
from zvt.domain import *
FinanceFactor.recorders
Traceback (most recent call last):
File "", line 1, in
AttributeError: type object 'FinanceFactor' has no attribute 'recorders'
Stock.record_data(provider='eastmoney')
Stock registered recorders:{'joinquant': <class 'zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder'>, 'exchange': <class 'zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder'>, 'eastmoney': <class 'zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder'>}
Empty DataFrame
Columns: [code, name, list_date]
Index: []
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context
context)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: too many SQL variables
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 1, in
File "D:\Anaconda3\lib\site-packages\zvdata_init_.py", line 260, in record_data
r.run()
File "E:\AITrader\SourceCode\zvt\zvt\recorders\exchange\china_stock_list_spider.py", line 23, in run
self.download_stock_list(response=resp, exchange='sh')
File "E:\AITrader\SourceCode\zvt\zvt\recorders\exchange\china_stock_list_spider.py", line 64, in download_stock_list
df_to_db(df=df, data_schema=self.data_schema, provider=self.provider, force_update=False)
File "D:\Anaconda3\lib\site-packages\zvdata\api.py", line 246, in df_to_db
ids=df_current['id'].tolist())
File "D:\Anaconda3\lib\site-packages\zvdata\api.py", line 128, in get_data
df = pd.read_sql(query.statement, query.session.bind)
File "D:\Anaconda3\lib\site-packages\pandas\io\sql.py", line 397, in read_sql
chunksize=chunksize)
File "D:\Anaconda3\lib\site-packages\pandas\io\sql.py", line 1099, in read_query
result = self.execute(*args)
File "D:\Anaconda3\lib\site-packages\pandas\io\sql.py", line 990, in execute
return self.connectable.execute(*args, **kwargs)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 2075, in execute
return connection.execute(statement, *multiparams, **params)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 948, in execute
return meth(self, multiparams, params)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\sql\elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1200, in _execute_context
context)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1413, in _handle_dbapi_exception
exc_info
File "D:\Anaconda3\lib\site-packages\sqlalchemy\util\compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\util\compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context
context)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) too many SQL variables [SQL: 'SELECT stock.id, stock.timestamp \nFROM stock \nWHERE stock.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ORDER BY stock.timestamp ASC'] [parameters: ('stock_sh_600000', 'stock_sh_600004', 'stock_sh_600006', 'stock_sh_600007', 'stock_sh_600008', 'stock_sh_600009', 'stock_sh_600010', 'stock_sh_600011', 'stock_sh_600012', 'stock_sh_600015', 'stock_sh_600016', 'stock_sh_600017', 'stock_sh_600018', 'stock_sh_600019', 'stock_sh_600020', 'stock_sh_600021', 'stock_sh_600022', 'stock_sh_600023', 'stock_sh_600025', 'stock_sh_600026', 'stock_sh_600027', 'stock_sh_600028', 'stock_sh_600029', 'stock_sh_600030', 'stock_sh_600031', 'stock_sh_600033', 'stock_sh_600035', 'stock_sh_600036', 'stock_sh_600037', 'stock_sh_600038', 'stock_sh_600039', 'stock_sh_600048', 'stock_sh_600050', 'stock_sh_600051', 'stock_sh_600052', 'stock_sh_600053', 'stock_sh_600054', 'stock_sh_600055', 'stock_sh_600056', 'stock_sh_600057', 'stock_sh_600058', 'stock_sh_600059', 'stock_sh_600060', 'stock_sh_600061', 'stock_sh_600062', 'stock_sh_600063', 'stock_sh_600064', 'stock_sh_600066', 'stock_sh_600067', 'stock_sh_600068', 'stock_sh_600069', 'stock_sh_600070', 'stock_sh_600071', 'stock_sh_600072', 'stock_sh_600073', 'stock_sh_600074', 'stock_sh_600075', 'stock_sh_600076', 'stock_sh_600077', 'stock_sh_600078', 'stock_sh_600079', 'stock_sh_600080', 'stock_sh_600081', 'stock_sh_600082', 'stock_sh_600083', 'stock_sh_600084', 'stock_sh_600085', 'stock_sh_600086', 'stock_sh_600088', 'stock_sh_600089', 'stock_sh_600090', 'stock_sh_600091', 'stock_sh_600093', 'stock_sh_600094', 'stock_sh_600095', 'stock_sh_600096', 'stock_sh_600097', 'stock_sh_600098', 'stock_sh_600099', 'stock_sh_600100', 'stock_sh_600101', 'stock_sh_600103', 'stock_sh_600104', 'stock_sh_600105', 'stock_sh_600106', 'stock_sh_600107', 'stock_sh_600108', 'stock_sh_600109', 'stock_sh_600110', 'stock_sh_600111', 'stock_sh_600112', 'stock_sh_600113', 'stock_sh_600114', 'stock_sh_600115', 'stock_sh_600116', 'stock_sh_600117', 'stock_sh_600118', 'stock_sh_600119', 'stock_sh_600120', 'stock_sh_600121', 'stock_sh_600122', 'stock_sh_600123', 'stock_sh_600125', 'stock_sh_600126', 'stock_sh_600127', 'stock_sh_600128', 'stock_sh_600129', 'stock_sh_600130', 'stock_sh_600131', 'stock_sh_600132', 'stock_sh_600133', 'stock_sh_600135', 'stock_sh_600136', 'stock_sh_600137', 'stock_sh_600138', 'stock_sh_600139', 'stock_sh_600141', 'stock_sh_600143', 'stock_sh_600145', 'stock_sh_600146', 'stock_sh_600148', 'stock_sh_600149', 'stock_sh_600150', 'stock_sh_600151', 'stock_sh_600152', 'stock_sh_600153', 'stock_sh_600155', 'stock_sh_600156', 'stock_sh_600157', 'stock_sh_600158', 'stock_sh_600159', 'stock_sh_600160', 'stock_sh_600161', 'stock_sh_600162', 'stock_sh_600163', 'stock_sh_600165', 'stock_sh_600166', 'stock_sh_600167', 'stock_sh_600168', 'stock_sh_600169', 'stock_sh_600170', 'stock_sh_600171', 'stock_sh_600172', 'stock_sh_600173', 'stock_sh_600175', 'stock_sh_600176', 'stock_sh_600177', 'stock_sh_600178', 'stock_sh_600179', 'stock_sh_600180', 'stock_sh_600182', 'stock_sh_600183', 'stock_sh_600184', 'stock_sh_600185', 'stock_sh_600186', 'stock_sh_600187', 'stock_sh_600188', 'stock_sh_600189', 'stock_sh_600190', 'stock_sh_600191', 'stock_sh_600192', 'stock_sh_600193', 'stock_sh_600195', 'stock_sh_600196', 'stock_sh_600197', 'stock_sh_600198', 'stock_sh_600199', 'stock_sh_600200', 'stock_sh_600201', 'stock_sh_600202', 'stock_sh_600203', 'stock_sh_600206', 'stock_sh_600207',
'stock_sh_600208', 'stock_sh_600209', 'stock_sh_600210', 'stock_sh_600211', 'stock_sh_600212', 'stock_sh_600213', 'stock_sh_600215', 'stock_sh_600216', 'stock_sh_600217', 'stock_sh_600218', 'stock_sh_600219', 'stock_sh_600220', 'stock_sh_600221', 'stock_sh_600222', 'stock_sh_600223', 'stock_sh_600225', 'stock_sh_600226', 'stock_sh_600227', 'stock_sh_600228', 'stock_sh_600229', 'stock_sh_600230', 'stock_sh_600231', 'stock_sh_600232', 'stock_sh_600233', 'stock_sh_600234', 'stock_sh_600235', 'stock_sh_600236', 'stock_sh_600237', 'stock_sh_600238', 'stock_sh_600239', 'stock_sh_600241', 'stock_sh_600242', 'stock_sh_600243', 'stock_sh_600246', 'stock_sh_600247', 'stock_sh_600248', 'stock_sh_600249', 'stock_sh_600250', 'stock_sh_600251', 'stock_sh_600252', 'stock_sh_600255', 'stock_sh_600256', 'stock_sh_600257', 'stock_sh_600258', 'stock_sh_600259', 'stock_sh_600260', 'stock_sh_600261', 'stock_sh_600262', 'stock_sh_600265', 'stock_sh_600266', 'stock_sh_600267', 'stock_sh_600268', 'stock_sh_600269', 'stock_sh_600271', 'stock_sh_600272', 'stock_sh_600273', 'stock_sh_600275', 'stock_sh_600276', 'stock_sh_600277', 'stock_sh_600278', 'stock_sh_600279', 'stock_sh_600280', 'stock_sh_600281', 'stock_sh_600282', 'stock_sh_600283', 'stock_sh_600284', 'stock_sh_600285', 'stock_sh_600287', 'stock_sh_600288', 'stock_sh_600289', 'stock_sh_600290', 'stock_sh_600291', 'stock_sh_600292', 'stock_sh_600293', 'stock_sh_600295', 'stock_sh_600297', 'stock_sh_600298', 'stock_sh_600299', 'stock_sh_600300', 'stock_sh_600301', 'stock_sh_600302', 'stock_sh_600303', 'stock_sh_600305', 'stock_sh_600306', 'stock_sh_600307', 'stock_sh_600308', 'stock_sh_600309', 'stock_sh_600310', 'stock_sh_600311', 'stock_sh_600312', 'stock_sh_600313', 'stock_sh_600315', 'stock_sh_600316', 'stock_sh_600317', 'stock_sh_600318', 'stock_sh_600319', 'stock_sh_600320', 'stock_sh_600321', 'stock_sh_600322', 'stock_sh_600323', 'stock_sh_600325', 'stock_sh_600326', 'stock_sh_600327', 'stock_sh_600328', 'stock_sh_600329', 'stock_sh_600330', 'stock_sh_600331', 'stock_sh_600332', 'stock_sh_600333', 'stock_sh_600335', 'stock_sh_600336', 'stock_sh_600337', 'stock_sh_600338', 'stock_sh_600339', 'stock_sh_600340', 'stock_sh_600343', 'stock_sh_600345', 'stock_sh_600346', 'stock_sh_600348', 'stock_sh_600350', 'stock_sh_600351', 'stock_sh_600352', 'stock_sh_600353', 'stock_sh_600354', 'stock_sh_600355', 'stock_sh_600356', 'stock_sh_600358', 'stock_sh_600359', 'stock_sh_600360', 'stock_sh_600361', 'stock_sh_600362', 'stock_sh_600363', 'stock_sh_600365', 'stock_sh_600366', 'stock_sh_600367', 'stock_sh_600368', 'stock_sh_600369', 'stock_sh_600370', 'stock_sh_600371', 'stock_sh_600372', 'stock_sh_600373', 'stock_sh_600375', 'stock_sh_600376', 'stock_sh_600377', 'stock_sh_600378', 'stock_sh_600379', 'stock_sh_600380', 'stock_sh_600381', 'stock_sh_600382', 'stock_sh_600383', 'stock_sh_600385', 'stock_sh_600386', 'stock_sh_600387', 'stock_sh_600388', 'stock_sh_600389', 'stock_sh_600390', 'stock_sh_600391', 'stock_sh_600392', 'stock_sh_600393', 'stock_sh_600395', 'stock_sh_600396', 'stock_sh_600397', 'stock_sh_600398', 'stock_sh_600399', 'stock_sh_600400', 'stock_sh_600403', 'stock_sh_600405', 'stock_sh_600406', 'stock_sh_600408', 'stock_sh_600409', 'stock_sh_600410', 'stock_sh_600415', 'stock_sh_600416', 'stock_sh_600418', 'stock_sh_600419', 'stock_sh_600420', 'stock_sh_600421', 'stock_sh_600422', 'stock_sh_600423', 'stock_sh_600425', 'stock_sh_600426', 'stock_sh_600428', 'stock_sh_600429', 'stock_sh_600433', 'stock_sh_600435', 'stock_sh_600436', 'stock_sh_600438', 'stock_sh_600439', 'stock_sh_600444', 'stock_sh_600446', 'stock_sh_600448', 'stock_sh_600449', 'stock_sh_600452', 'stock_sh_600455', 'stock_sh_600456', 'stock_sh_600458', 'stock_sh_600459', 'stock_sh_600460', 'stock_sh_600461', 'stock_sh_600462', 'stock_sh_600463', 'stock_sh_600466', 'stock_sh_600467', 'stock_sh_600468', 'stock_sh_600469', 'stock_sh_600470', 'stock_sh_600475', 'stock_sh_600476', 'stock_sh_600477', 'stock_sh_600478', 'stock_sh_600479', 'stock_sh_600480', 'stock_sh_600481', 'stock_sh_600482', 'stock_sh_600483', 'stock_sh_600485', 'stock_sh_600486', 'stock_sh_600487', 'stock_sh_600488', 'stock_sh_600489', 'stock_sh_600490', 'stock_sh_600491', 'stock_sh_600493', 'stock_sh_600495', 'stock_sh_600496', 'stock_sh_600497', 'stock_sh_600498', 'stock_sh_600499', 'stock_sh_600500', 'stock_sh_600501', 'stock_sh_600502', 'stock_sh_600503', 'stock_sh_600505', 'stock_sh_600506', 'stock_sh_600507', 'stock_sh_600508', 'stock_sh_600509', 'stock_sh_600510', 'stock_sh_600511', 'stock_sh_600512', 'stock_sh_600513', 'stock_sh_600515', 'stock_sh_600516', 'stock_sh_600517', 'stock_sh_600518', 'stock_sh_600519', 'stock_sh_600520', 'stock_sh_600521', 'stock_sh_600522', 'stock_sh_600523', 'stock_sh_600525', 'stock_sh_600526', 'stock_sh_600527', 'stock_sh_600528', 'stock_sh_600529', 'stock_sh_600530', 'stock_sh_600531', 'stock_sh_600532', 'stock_sh_600533', 'stock_sh_600535', 'stock_sh_600536', 'stock_sh_600537', 'stock_sh_600538', 'stock_sh_600539', 'stock_sh_600540', 'stock_sh_600543', 'stock_sh_600545', 'stock_sh_600546', 'stock_sh_600547', 'stock_sh_600548', 'stock_sh_600549', 'stock_sh_600550', 'stock_sh_600551', 'stock_sh_600552', 'stock_sh_600555', 'stock_sh_600556', 'stock_sh_600557', 'stock_sh_600558', 'stock_sh_600559', 'stock_sh_600560', 'stock_sh_600561', 'stock_sh_600562', 'stock_sh_600563', 'stock_sh_600565', 'stock_sh_600566', 'stock_sh_600567', 'stock_sh_600568', 'stock_sh_600569', 'stock_sh_600570', 'stock_sh_600571', 'stock_sh_600572', 'stock_sh_600573', 'stock_sh_600575', 'stock_sh_600576', 'stock_sh_600577', 'stock_sh_600578', 'stock_sh_600579', 'stock_sh_600580', 'stock_sh_600581', 'stock_sh_600582', 'stock_sh_600583', 'stock_sh_600584', 'stock_sh_600585', 'stock_sh_600586', 'stock_sh_600587', 'stock_sh_600588', 'stock_sh_600589', 'stock_sh_600590', 'stock_sh_600592', 'stock_sh_600593', 'stock_sh_600594', 'stock_sh_600595', 'stock_sh_600596', 'stock_sh_600597', 'stock_sh_600598', 'stock_sh_600599', 'stock_sh_600600', 'stock_sh_600601', 'stock_sh_600602', 'stock_sh_600603', 'stock_sh_600604', 'stock_sh_600605', 'stock_sh_600606', 'stock_sh_600608', 'stock_sh_600609', 'stock_sh_600610', 'stock_sh_600611', 'stock_sh_600612', 'stock_sh_600613', 'stock_sh_600614', 'stock_sh_600615', 'stock_sh_600616', 'stock_sh_600617', 'stock_sh_600618', 'stock_sh_600619', 'stock_sh_600620', 'stock_sh_600621', 'stock_sh_600622', 'stock_sh_600623', 'stock_sh_600624', 'stock_sh_600626', 'stock_sh_600628', 'stock_sh_600629', 'stock_sh_600630', 'stock_sh_600633', 'stock_sh_600634', 'stock_sh_600635', 'stock_sh_600636', 'stock_sh_600637', 'stock_sh_600638', 'stock_sh_600639', 'stock_sh_600640', 'stock_sh_600641', 'stock_sh_600642', 'stock_sh_600643', 'stock_sh_600644', 'stock_sh_600645', 'stock_sh_600647', 'stock_sh_600648', 'stock_sh_600649', 'stock_sh_600650', 'stock_sh_600651', 'stock_sh_600652', 'stock_sh_600653', 'stock_sh_600654', 'stock_sh_600655', 'stock_sh_600657', 'stock_sh_600658', 'stock_sh_600660', 'stock_sh_600661', 'stock_sh_600662', 'stock_sh_600663', 'stock_sh_600664', 'stock_sh_600665', 'stock_sh_600666', 'stock_sh_600667', 'stock_sh_600668', 'stock_sh_600671', 'stock_sh_600673', 'stock_sh_600674', 'stock_sh_600675', 'stock_sh_600676', 'stock_sh_600677', 'stock_sh_600678', 'stock_sh_600679', 'stock_sh_600681', 'stock_sh_600682', 'stock_sh_600683', 'stock_sh_600684', 'stock_sh_600685', 'stock_sh_600686', 'stock_sh_600687', 'stock_sh_600688', 'stock_sh_600689', 'stock_sh_600690', 'stock_sh_600691', 'stock_sh_600692', 'stock_sh_600693', 'stock_sh_600694', 'stock_sh_600695', 'stock_sh_600696', 'stock_sh_600697', 'stock_sh_600698', 'stock_sh_600699', 'stock_sh_600701', 'stock_sh_600702', 'stock_sh_600703', 'stock_sh_600704', 'stock_sh_600705', 'stock_sh_600706', 'stock_sh_600707', 'stock_sh_600708', 'stock_sh_600710', 'stock_sh_600711', 'stock_sh_600712', 'stock_sh_600713', 'stock_sh_600714', 'stock_sh_600715', 'stock_sh_600716', 'stock_sh_600717', 'stock_sh_600718','stock_sh_600719', 'stock_sh_600720', 'stock_sh_600721', 'stock_sh_600722', 'stock_sh_600723', 'stock_sh_600724', 'stock_sh_600725', 'stock_sh_600726', 'stock_sh_600727', 'stock_sh_600728', 'stock_sh_600729', 'stock_sh_600730', 'stock_sh_600731', 'stock_sh_600732', 'stock_sh_600733', 'stock_sh_600734', 'stock_sh_600735', 'stock_sh_600736', 'stock_sh_600737', 'stock_sh_600738', 'stock_sh_600739', 'stock_sh_600740', 'stock_sh_600741', 'stock_sh_600742', 'stock_sh_600743', 'stock_sh_600744', 'stock_sh_600745', 'stock_sh_600746', 'stock_sh_600748', 'stock_sh_600749', 'stock_sh_600750', 'stock_sh_600751', 'stock_sh_600753', 'stock_sh_600754', 'stock_sh_600755', 'stock_sh_600756', 'stock_sh_600757', 'stock_sh_600758', 'stock_sh_600759', 'stock_sh_600760', 'stock_sh_600761', 'stock_sh_600763', 'stock_sh_600764', 'stock_sh_600765', 'stock_sh_600766', 'stock_sh_600767', 'stock_sh_600768', 'stock_sh_600769', 'stock_sh_600770', 'stock_sh_600771', 'stock_sh_600773', 'stock_sh_600774', 'stock_sh_600775', 'stock_sh_600776', 'stock_sh_600777', 'stock_sh_600778', 'stock_sh_600779', 'stock_sh_600780', 'stock_sh_600781', 'stock_sh_600782', 'stock_sh_600783', 'stock_sh_600784', 'stock_sh_600785', 'stock_sh_600787', 'stock_sh_600789', 'stock_sh_600790', 'stock_sh_600791', 'stock_sh_600792', 'stock_sh_600793', 'stock_sh_600794', 'stock_sh_600795', 'stock_sh_600796', 'stock_sh_600797', 'stock_sh_600798', 'stock_sh_600800', 'stock_sh_600801', 'stock_sh_600802', 'stock_sh_600803', 'stock_sh_600804', 'stock_sh_600805', 'stock_sh_600807', 'stock_sh_600808', 'stock_sh_600809', 'stock_sh_600810', 'stock_sh_600811', 'stock_sh_600812', 'stock_sh_600814', 'stock_sh_600815', 'stock_sh_600816', 'stock_sh_600817', 'stock_sh_600818', 'stock_sh_600819', 'stock_sh_600820', 'stock_sh_600821', 'stock_sh_600822', 'stock_sh_600823', 'stock_sh_600824', 'stock_sh_600825', 'stock_sh_600826', 'stock_sh_600827', 'stock_sh_600828', 'stock_sh_600829', 'stock_sh_600830', 'stock_sh_600831', 'stock_sh_600833', 'stock_sh_600834', 'stock_sh_600835', 'stock_sh_600836', 'stock_sh_600837', 'stock_sh_600838', 'stock_sh_600839', 'stock_sh_600841', 'stock_sh_600843', 'stock_sh_600844', 'stock_sh_600845', 'stock_sh_600846', 'stock_sh_600847', 'stock_sh_600848', 'stock_sh_600850', 'stock_sh_600851', 'stock_sh_600853', 'stock_sh_600854', 'stock_sh_600855', 'stock_sh_600856', 'stock_sh_600857', 'stock_sh_600858', 'stock_sh_600859', 'stock_sh_600860', 'stock_sh_600861', 'stock_sh_600862', 'stock_sh_600863', 'stock_sh_600864', 'stock_sh_600865', 'stock_sh_600866', 'stock_sh_600867', 'stock_sh_600868', 'stock_sh_600869', 'stock_sh_600870', 'stock_sh_600871', 'stock_sh_600872', 'stock_sh_600873', 'stock_sh_600874', 'stock_sh_600875', 'stock_sh_600876', 'stock_sh_600877', 'stock_sh_600879', 'stock_sh_600880', 'stock_sh_600881', 'stock_sh_600882', 'stock_sh_600883', 'stock_sh_600884', 'stock_sh_600885', 'stock_sh_600886', 'stock_sh_600887', 'stock_sh_600888', 'stock_sh_600889', 'stock_sh_600890', 'stock_sh_600891', 'stock_sh_600892', 'stock_sh_600893', 'stock_sh_600894', 'stock_sh_600895', 'stock_sh_600896', 'stock_sh_600897', 'stock_sh_600898', 'stock_sh_600900', 'stock_sh_600901', 'stock_sh_600903', 'stock_sh_600908', 'stock_sh_600909', 'stock_sh_600917', 'stock_sh_600919', 'stock_sh_600926', 'stock_sh_600928', 'stock_sh_600929', 'stock_sh_600933', 'stock_sh_600936', 'stock_sh_600939', 'stock_sh_600958', 'stock_sh_600959', 'stock_sh_600960', 'stock_sh_600961', 'stock_sh_600962', 'stock_sh_600963', 'stock_sh_600965', 'stock_sh_600966', 'stock_sh_600967', 'stock_sh_600968', 'stock_sh_600969', 'stock_sh_600970', 'stock_sh_600971', 'stock_sh_600973', 'stock_sh_600975', 'stock_sh_600976', 'stock_sh_600977', 'stock_sh_600978', 'stock_sh_600979', 'stock_sh_600980', 'stock_sh_600981', 'stock_sh_600982', 'stock_sh_600983', 'stock_sh_600984', 'stock_sh_600985', 'stock_sh_600986', 'stock_sh_600987', 'stock_sh_600988', 'stock_sh_600989', 'stock_sh_600990', 'stock_sh_600992', 'stock_sh_600993', 'stock_sh_600995', 'stock_sh_600996', 'stock_sh_600997', 'stock_sh_600998', 'stock_sh_600999', 'stock_sh_601000', 'stock_sh_601001', 'stock_sh_601002', 'stock_sh_601003', 'stock_sh_601005', 'stock_sh_601006', 'stock_sh_601007', 'stock_sh_601008', 'stock_sh_601009', 'stock_sh_601010', 'stock_sh_601011', 'stock_sh_601012', 'stock_sh_601015', 'stock_sh_601016', 'stock_sh_601018', 'stock_sh_601019', 'stock_sh_601020', 'stock_sh_601021', 'stock_sh_601028', 'stock_sh_601038', 'stock_sh_601058', 'stock_sh_601066', 'stock_sh_601068', 'stock_sh_601069', 'stock_sh_601077', 'stock_sh_601086', 'stock_sh_601088', 'stock_sh_601098', 'stock_sh_601099', 'stock_sh_601100', 'stock_sh_601101', 'stock_sh_601106', 'stock_sh_601107', 'stock_sh_601108', 'stock_sh_601111', 'stock_sh_601113', 'stock_sh_601116', 'stock_sh_601117', 'stock_sh_601118', 'stock_sh_601126', 'stock_sh_601127', 'stock_sh_601128', 'stock_sh_601137', 'stock_sh_601138', 'stock_sh_601139', 'stock_sh_601155', 'stock_sh_601158', 'stock_sh_601162', 'stock_sh_601163', 'stock_sh_601166', 'stock_sh_601168', 'stock_sh_601169', 'stock_sh_601177', 'stock_sh_601179', 'stock_sh_601186', 'stock_sh_601188', 'stock_sh_601198', 'stock_sh_601199', 'stock_sh_601200', 'stock_sh_601208', 'stock_sh_601211', 'stock_sh_601212', 'stock_sh_601216', 'stock_sh_601218', 'stock_sh_601222', 'stock_sh_601225', 'stock_sh_601226', 'stock_sh_601228', 'stock_sh_601229', 'stock_sh_601231', 'stock_sh_601233', 'stock_sh_601236', 'stock_sh_601238', 'stock_sh_601258', 'stock_sh_601288', 'stock_sh_601298', 'stock_sh_601311', 'stock_sh_601318', 'stock_sh_601319', 'stock_sh_601326', 'stock_sh_601328', 'stock_sh_601330', 'stock_sh_601333', 'stock_sh_601336', 'stock_sh_601339', 'stock_sh_601360', 'stock_sh_601366', 'stock_sh_601368', 'stock_sh_601369', 'stock_sh_601375', 'stock_sh_601377', 'stock_sh_601388', 'stock_sh_601390', 'stock_sh_601398', 'stock_sh_601500', 'stock_sh_601512', 'stock_sh_601515', 'stock_sh_601518', 'stock_sh_601519', 'stock_sh_601555', 'stock_sh_601558', 'stock_sh_601566', 'stock_sh_601567', 'stock_sh_601577', 'stock_sh_601579', 'stock_sh_601588', 'stock_sh_601595', 'stock_sh_601598', 'stock_sh_601599', 'stock_sh_601600', 'stock_sh_601601', 'stock_sh_601606', 'stock_sh_601607', 'stock_sh_601608', 'stock_sh_601611', 'stock_sh_601615', 'stock_sh_601616', 'stock_sh_601618', 'stock_sh_601619', 'stock_sh_601628', 'stock_sh_601633', 'stock_sh_601636', 'stock_sh_601658', 'stock_sh_601666', 'stock_sh_601668', 'stock_sh_601669', 'stock_sh_601677', 'stock_sh_601678', 'stock_sh_601688', 'stock_sh_601689', 'stock_sh_601696', 'stock_sh_601698', 'stock_sh_601699', 'stock_sh_601700', 'stock_sh_601717', 'stock_sh_601718', 'stock_sh_601727', 'stock_sh_601766', 'stock_sh_601777', 'stock_sh_601788', 'stock_sh_601789', 'stock_sh_601798', 'stock_sh_601799', 'stock_sh_601800', 'stock_sh_601801', 'stock_sh_601808', 'stock_sh_601811', 'stock_sh_601816', 'stock_sh_601818', 'stock_sh_601828', 'stock_sh_601838', 'stock_sh_601857', 'stock_sh_601858', 'stock_sh_601860', 'stock_sh_601865', 'stock_sh_601866', 'stock_sh_601869', 'stock_sh_601872', 'stock_sh_601877', 'stock_sh_601878', 'stock_sh_601880', 'stock_sh_601881', 'stock_sh_601882', 'stock_sh_601886', 'stock_sh_601888', 'stock_sh_601890', 'stock_sh_601898', 'stock_sh_601899', 'stock_sh_601900', 'stock_sh_601901', 'stock_sh_601908', 'stock_sh_601916', 'stock_sh_601918', 'stock_sh_601919', 'stock_sh_601928', 'stock_sh_601929', 'stock_sh_601933', 'stock_sh_601939', 'stock_sh_601949', 'stock_sh_601952', 'stock_sh_601958', 'stock_sh_601965', 'stock_sh_601966', 'stock_sh_601968', 'stock_sh_601969', 'stock_sh_601975', 'stock_sh_601985', 'stock_sh_601988', 'stock_sh_601989', 'stock_sh_601990', 'stock_sh_601991', 'stock_sh_601992', 'stock_sh_601996', 'stock_sh_601997', 'stock_sh_601998', 'stock_sh_601999', 'stock_sh_603000', 'stock_sh_603001', 'stock_sh_603002', 'stock_sh_603003', 'stock_sh_603005', 'stock_sh_603006', 'stock_sh_603007', 'stock_sh_603008', 'stock_sh_603009', 'stock_sh_603010', 'stock_sh_603011', 'stock_sh_603012', 'stock_sh_603013', 'stock_sh_603015', 'stock_sh_603016', 'stock_sh_603017', 'stock_sh_603018', 'stock_sh_603019', 'stock_sh_603020', 'stock_sh_603021', 'stock_sh_603022', 'stock_sh_603023', 'stock_sh_603025', 'stock_sh_603026', 'stock_sh_603027', 'stock_sh_603028', 'stock_sh_603029', 'stock_sh_603030', 'stock_sh_603031', 'stock_sh_603032', 'stock_sh_603033', 'stock_sh_603035', 'stock_sh_603036', 'stock_sh_603037', 'stock_sh_603038', 'stock_sh_603039', 'stock_sh_603040', 'stock_sh_603041', 'stock_sh_603042', 'stock_sh_603043', 'stock_sh_603045', 'stock_sh_603050', 'stock_sh_603053', 'stock_sh_603055', 'stock_sh_603056', 'stock_sh_603058', 'stock_sh_603059', 'stock_sh_603060', 'stock_sh_603063', 'stock_sh_603066', 'stock_sh_603067', 'stock_sh_603068', 'stock_sh_603069', 'stock_sh_603076', 'stock_sh_603077', 'stock_sh_603078', 'stock_sh_603079', 'stock_sh_603080', 'stock_sh_603081', 'stock_sh_603083', 'stock_sh_603085', 'stock_sh_603086', 'stock_sh_603088', 'stock_sh_603089', 'stock_sh_603090', 'stock_sh_603093', 'stock_sh_603096', 'stock_sh_603098', 'stock_sh_603099', 'stock_sh_603100', 'stock_sh_603101', 'stock_sh_603103', 'stock_sh_603105', 'stock_sh_603106', 'stock_sh_603108', 'stock_sh_603109', 'stock_sh_603110', 'stock_sh_603111', 'stock_sh_603113', 'stock_sh_603115', 'stock_sh_603116', 'stock_sh_603117', 'stock_sh_603118', 'stock_sh_603121', 'stock_sh_603123', 'stock_sh_603126', 'stock_sh_603127', 'stock_sh_603128', 'stock_sh_603129', 'stock_sh_603131', 'stock_sh_603133', 'stock_sh_603136', 'stock_sh_603138', 'stock_sh_603139', 'stock_sh_603156', 'stock_sh_603157', 'stock_sh_603158', 'stock_sh_603159', 'stock_sh_603160', 'stock_sh_603161', 'stock_sh_603165', 'stock_sh_603166', 'stock_sh_603167', 'stock_sh_603168', 'stock_sh_603169', 'stock_sh_603177', 'stock_sh_603178', 'stock_sh_603179', 'stock_sh_603180', 'stock_sh_603181', 'stock_sh_603183', 'stock_sh_603185', 'stock_sh_603186', 'stock_sh_603187', 'stock_sh_603188', 'stock_sh_603189', 'stock_sh_603192', 'stock_sh_603195', 'stock_sh_603196', 'stock_sh_603197', 'stock_sh_603198', 'stock_sh_603199', 'stock_sh_603200', 'stock_sh_603203', 'stock_sh_603208', 'stock_sh_603214', 'stock_sh_603217', 'stock_sh_603218', 'stock_sh_603220', 'stock_sh_603221', 'stock_sh_603222', 'stock_sh_603223', 'stock_sh_603225', 'stock_sh_603226', 'stock_sh_603227', 'stock_sh_603228', 'stock_sh_603229', 'stock_sh_603232', 'stock_sh_603233', 'stock_sh_603236', 'stock_sh_603238', 'stock_sh_603239', 'stock_sh_603256', 'stock_sh_603258', 'stock_sh_603259', 'stock_sh_603260', 'stock_sh_603266', 'stock_sh_603267', 'stock_sh_603268', 'stock_sh_603269', 'stock_sh_603277', 'stock_sh_603278', 'stock_sh_603279', 'stock_sh_603283', 'stock_sh_603286', 'stock_sh_603288', 'stock_sh_603289', 'stock_sh_603290', 'stock_sh_603297', 'stock_sh_603298', 'stock_sh_603299', 'stock_sh_603300', 'stock_sh_603301', 'stock_sh_603303', 'stock_sh_603305', 'stock_sh_603306', 'stock_sh_603308', 'stock_sh_603309', 'stock_sh_603311', 'stock_sh_603313', 'stock_sh_603315', 'stock_sh_603316', 'stock_sh_603317', 'stock_sh_603318', 'stock_sh_603319', 'stock_sh_603320', 'stock_sh_603321', 'stock_sh_603322', 'stock_sh_603323', 'stock_sh_603326', 'stock_sh_603327', 'stock_sh_603328', 'stock_sh_603329', 'stock_sh_603330', 'stock_sh_603331', 'stock_sh_603332', 'stock_sh_603333', 'stock_sh_603335', 'stock_sh_603336', 'stock_sh_603337', 'stock_sh_603338', 'stock_sh_603339', 'stock_sh_603345', 'stock_sh_603348', 'stock_sh_603351', 'stock_sh_603355', 'stock_sh_603356', 'stock_sh_603357', 'stock_sh_603358', 'stock_sh_603359', 'stock_sh_603360', 'stock_sh_603363', 'stock_sh_603365', 'stock_sh_603366', 'stock_sh_603367', 'stock_sh_603368', 'stock_sh_603369', 'stock_sh_603377', 'stock_sh_603378', 'stock_sh_603379', 'stock_sh_603380', 'stock_sh_603383', 'stock_sh_603385', 'stock_sh_603386', 'stock_sh_603387', 'stock_sh_603388', 'stock_sh_603389', 'stock_sh_603390', 'stock_sh_603393', 'stock_sh_603396', 'stock_sh_603398', 'stock_sh_603399', 'stock_sh_603416', 'stock_sh_603421', 'stock_sh_603429', 'stock_sh_603444', 'stock_sh_603456', 'stock_sh_603458', 'stock_sh_603466', 'stock_sh_603477', 'stock_sh_603486', 'stock_sh_603488', 'stock_sh_603489', 'stock_sh_603496', 'stock_sh_603499', 'stock_sh_603500', 'stock_sh_603501', 'stock_sh_603505', 'stock_sh_603506', 'stock_sh_603507', 'stock_sh_603508', 'stock_sh_603515', 'stock_sh_603516', 'stock_sh_603517', 'stock_sh_603518', 'stock_sh_603519', 'stock_sh_603520', 'stock_sh_603527', 'stock_sh_603528', 'stock_sh_603530', 'stock_sh_603533', 'stock_sh_603535', 'stock_sh_603536', 'stock_sh_603538', 'stock_sh_603551', 'stock_sh_603555', 'stock_sh_603556', 'stock_sh_603557', 'stock_sh_603558', 'stock_sh_603559', 'stock_sh_603566', 'stock_sh_603567', 'stock_sh_603568', 'stock_sh_603569', 'stock_sh_603577', 'stock_sh_603578', 'stock_sh_603579', 'stock_sh_603580', 'stock_sh_603583', 'stock_sh_603585', 'stock_sh_603586', 'stock_sh_603587', 'stock_sh_603588', 'stock_sh_603589', 'stock_sh_603590', 'stock_sh_603595', 'stock_sh_603596', 'stock_sh_603598', 'stock_sh_603599', 'stock_sh_603600', 'stock_sh_603601', 'stock_sh_603602', 'stock_sh_603603', 'stock_sh_603605', 'stock_sh_603606', 'stock_sh_603607', 'stock_sh_603608', 'stock_sh_603609', 'stock_sh_603610', 'stock_sh_603611', 'stock_sh_603612', 'stock_sh_603613', 'stock_sh_603615', 'stock_sh_603616', 'stock_sh_603617', 'stock_sh_603618', 'stock_sh_603619', 'stock_sh_603626', 'stock_sh_603628', 'stock_sh_603629', 'stock_sh_603630', 'stock_sh_603633', 'stock_sh_603636', 'stock_sh_603637', 'stock_sh_603638', 'stock_sh_603639', 'stock_sh_603648', 'stock_sh_603650', 'stock_sh_603655', 'stock_sh_603656', 'stock_sh_603657', 'stock_sh_603658', 'stock_sh_603659', 'stock_sh_603660', 'stock_sh_603661', 'stock_sh_603662', 'stock_sh_603663', 'stock_sh_603665', 'stock_sh_603666', 'stock_sh_603667', 'stock_sh_603668', 'stock_sh_603669', 'stock_sh_603676', 'stock_sh_603677', 'stock_sh_603678', 'stock_sh_603679', 'stock_sh_603680', 'stock_sh_603681', 'stock_sh_603683', 'stock_sh_603685', 'stock_sh_603686', 'stock_sh_603687', 'stock_sh_603688', 'stock_sh_603689', 'stock_sh_603690', 'stock_sh_603693', 'stock_sh_603696', 'stock_sh_603697', 'stock_sh_603698', 'stock_sh_603699', 'stock_sh_603700', 'stock_sh_603701', 'stock_sh_603703', 'stock_sh_603706', 'stock_sh_603707', 'stock_sh_603708', 'stock_sh_603709', 'stock_sh_603711', 'stock_sh_603712', 'stock_sh_603713', 'stock_sh_603716', 'stock_sh_603717', 'stock_sh_603718', 'stock_sh_603719', 'stock_sh_603721', 'stock_sh_603722', 'stock_sh_603725', 'stock_sh_603726', 'stock_sh_603727', 'stock_sh_603728', 'stock_sh_603729', 'stock_sh_603730', 'stock_sh_603733', 'stock_sh_603737', 'stock_sh_603738', 'stock_sh_603739', 'stock_sh_603755', 'stock_sh_603757', 'stock_sh_603758', 'stock_sh_603766', 'stock_sh_603767', 'stock_sh_603768', 'stock_sh_603773', 'stock_sh_603776', 'stock_sh_603777', 'stock_sh_603778', 'stock_sh_603779', 'stock_sh_603786', 'stock_sh_603787', 'stock_sh_603788', 'stock_sh_603789', 'stock_sh_603790', 'stock_sh_603797', 'stock_sh_603798', 'stock_sh_603799', 'stock_sh_603800', 'stock_sh_603801', 'stock_sh_603803', 'stock_sh_603806','stock_sh_603808', 'stock_sh_603809', 'stock_sh_603810', 'stock_sh_603811', 'stock_sh_603813', 'stock_sh_603815', 'stock_sh_603816', 'stock_sh_603817', 'stock_sh_603818', 'stock_sh_603819', 'stock_sh_603822', 'stock_sh_603823', 'stock_sh_603825', 'stock_sh_603826', 'stock_sh_603828', 'stock_sh_603829', 'stock_sh_603833', 'stock_sh_603838', 'stock_sh_603839', 'stock_sh_603843', 'stock_sh_603848', 'stock_sh_603855', 'stock_sh_603856', 'stock_sh_603858', 'stock_sh_603859', 'stock_sh_603860', 'stock_sh_603861', 'stock_sh_603863', 'stock_sh_603866', 'stock_sh_603867', 'stock_sh_603868', 'stock_sh_603869', 'stock_sh_603871', 'stock_sh_603876', 'stock_sh_603877', 'stock_sh_603878', 'stock_sh_603879', 'stock_sh_603880', 'stock_sh_603881', 'stock_sh_603882', 'stock_sh_603883', 'stock_sh_603885', 'stock_sh_603886', 'stock_sh_603887', 'stock_sh_603888', 'stock_sh_603889', 'stock_sh_603890', 'stock_sh_603893', 'stock_sh_603895', 'stock_sh_603896', 'stock_sh_603897', 'stock_sh_603898', 'stock_sh_603899', 'stock_sh_603900', 'stock_sh_603901', 'stock_sh_603903', 'stock_sh_603906', 'stock_sh_603908', 'stock_sh_603909', 'stock_sh_603912', 'stock_sh_603915', 'stock_sh_603916', 'stock_sh_603917', 'stock_sh_603918', 'stock_sh_603919', 'stock_sh_603920', 'stock_sh_603922', 'stock_sh_603926', 'stock_sh_603927', 'stock_sh_603928', 'stock_sh_603929', 'stock_sh_603933', 'stock_sh_603936', 'stock_sh_603937', 'stock_sh_603938', 'stock_sh_603939', 'stock_sh_603948', 'stock_sh_603949', 'stock_sh_603955', 'stock_sh_603956', 'stock_sh_603958', 'stock_sh_603959', 'stock_sh_603960', 'stock_sh_603963', 'stock_sh_603966', 'stock_sh_603967', 'stock_sh_603968', 'stock_sh_603969', 'stock_sh_603970', 'stock_sh_603976', 'stock_sh_603977', 'stock_sh_603978', 'stock_sh_603979', 'stock_sh_603980', 'stock_sh_603982', 'stock_sh_603983', 'stock_sh_603985', 'stock_sh_603986', 'stock_sh_603987', 'stock_sh_603988', 'stock_sh_603989', 'stock_sh_603990', 'stock_sh_603991', 'stock_sh_603992', 'stock_sh_603993', 'stock_sh_603995', 'stock_sh_603996', 'stock_sh_603997', 'stock_sh_603998', 'stock_sh_603999')] (Background on this error at: http://sqlalche.me/e/e3q8)
AttributeError: 'Stock' object has no attribute 'industries'
请问,是否有如下东西:
1、模型升级的sql文件
2、migration脚本?
如东财,有一段更数账务数据,会遇到判断这个票是什么类型的东西,更新后的代码就没有这个归属关系,导致跑数异常
def get_company_type(stock_domain: StockDetail):
industries = stock_domain.industries.split(',')
if ('银行' in industries) or ('信托' in industries):
return CompanyType.yinhang
if '保险' in industries:
return CompanyType.baoxian
if '证券' in industries:
return CompanyType.quanshang
return CompanyType.qiye
def company_type_flag(security_item):
try:
company_type = get_company_type(security_item)
if company_type == CompanyType.qiye:
return "4"
if company_type == CompanyType.quanshang:
return "1"
if company_type == CompanyType.baoxian:
return "2"
if company_type == CompanyType.yinhang:
return "3"
except Exception as e:
logger.exception(f"id{security_item.code}-{security_item.industries}", e)
param = {
"color": "w",
"fc": get_fc(security_item)
}
resp = requests.post('https://emh5.eastmoney.com/api/CaiWuFenXi/GetCompanyType', json=param)
ct = resp.json().get('Result').get('CompanyType')
logger.warning("{} not catching company type:{}".format(security_item, ct))
return ct
IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: coin_tick_kdata.id [SQL: 'INSERT INTO coin_tick_kdata (id, entity_id, timestamp, provider, code, name, level, "order", price, volume, turnover, direction, order_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: (('coin_binance_BTC/USDT_2019-12-26T14:51:31.552', 'coin_binance_BTC/USDT', '2019-12-26 14:51:31.552000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.15, 0.161462, 1164.9725492999999, 'sell', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:31.552_1', 'coin_binance_BTC/USDT', '2019-12-26 14:51:31.552000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.91, 0.041979, 302.91668589, 'buy', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:31.552_2', 'coin_binance_BTC/USDT', '2019-12-26 14:51:31.552000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.94, 0.251136, 1812.18230784, 'buy', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:31.961', 'coin_binance_BTC/USDT', '2019-12-26 14:51:31.961000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.91, 0.001551, 11.19187641, 'buy', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:34.138', 'coin_binance_BTC/USDT', '2019-12-26 14:51:34.138000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.43, 0.088969, 641.94959167, 'buy', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:36.413', 'coin_binance_BTC/USDT', '2019-12-26 14:51:36.413000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7214.91, 0.142148, 1025.58502668, 'sell', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:36.413_3', 'coin_binance_BTC/USDT', '2019-12-26 14:51:36.413000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7214.9, 0.24856, 1793.335544, 'sell', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:36.413_4', 'coin_binance_BTC/USDT', '2019-12-26 14:51:36.413000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7214.88, 0.109292, 788.52866496, 'sell', None), ('coin_binance_BTC/USDT_2019-12-26T14:51:37.382', 'coin_binance_BTC/USDT', '2019-12-26 14:51:37.382000', 'ccxt', 'BTC/USDT', 'BTC/USDT', 'tick', None, 7215.37, 0.711563, 5134.190323309999, 'buy', None))] (Background on this error at: http://sqlalche.me/e/gkpj)
相同的时间点,多个数据,重新生成的id跟数据库已经存储的重复。
不知数据都支持什么级别的,分钟和tick的回测支持么。
目前使用过几个聚宽、米筐等,觉得易用性还是聚宽好一点,米筐的网站使用分钟数据回测也可以。
但米筐开源的rqalpha在本地没有分钟或tick数据,也没有换手率数据,本地写策略不甚方便。
另外,策略不止使用标的的K线数据;使用了持仓数据,不知ZVT是否有类似聚宽、米筐的context对象供写策略时调用持仓信息.
回测和模拟交易是否支持bar的开盘价撮合。
聚宽的回测支持开盘价撮合,模拟交易在09:27就发交易信号了,实盘跟单很是方便.
目标:
我是刚开始量化这方面的学习,一直在寻找一个简单易用的本地量化程序。
我发现这个项目的数据是很齐全的,不过我不知道该如何开始编写我自己的策略,并用它来走遍全部流程。
如果有这方面的example就好了。或者希望能在Readme中添加相关知识文档的链接,比如我现在其实不太懂Factor该怎么自定义和使用。
适用于:多标的 某周期 某指标的比较
目前代码中没有 ETF 数据的抓取,此 issue 为该功能的相关讨论。
希望把A股代码和数字货币等其他交易代码独立出来,这样新人在拿到代码后可以快速熟悉和参与开发自己要进行的交易代码,免得代码过于复杂后增加开发人员和维护人员的负担,不利于后期维护
目前东财数据的recorder没有开源,为了该数据源能够更长久的使用,打算使用基础数据+patch中转更新的方式来提供.
基础数据(到2019-07-06):
https://pan.baidu.com/s/17iLVJDcRnmu-LgRGFqItNA
提取码: pv9d
增量数据更新方案:
可以使用sqlite diff工具来生成diff,把diff单独放一个repo,或者自己的服务器,或者ocs
zvdata是recorder,factor的抽象实现,不包含具体的实现,zvt通过注册的方式实现相应的金融数据的recorder和factor.
抓取和分析其他类型的数据使用zvdata也很容易实现。
目前自己跑了一些定时任务,定时推送符合条件的个股,需要的可以把自己的邮箱pr到该文件:
https://github.com/zvtvz/zvt/blob/master/examples/reports/subscriber_emails.json
比如:
**核心资产
即使选了相同的股,不同的人操作还是千差万别,所以,公开也没什么。
这里面的选股器是可以直接回测的,回测的通知信号也可以发送。
dcc.Graph无法找到,具体看下面。
def get_trader_detail_figures(trader_domain: business.Trader,
account_reader: AccountReader,
order_reader: OrderReader):
graph_list = []
if account_reader:
account_data, account_layout = account_reader.data_drawer().draw_line(render=None, keep_ui_state=False)
for trader_name in account_reader.trader_names:
graph_list.append(dcc.Graph(
有些报表的数据会存在调整,比如万华化学本年三季报就对去年的三季节进行了调整,这种情况下程序应该是无感知的,有没有办法让程序去进行更新?
t = MyMaTrader(codes=['000338'], level=IntervalLevel.LEVEL_1DAY, start_timestamp='2019-01-01',
...: ...: end_timestamp='2019-06-30', trader_name='000338_ma_trader')
InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Origi
nal exception was: (sqlite3.IntegrityError) UNIQUE constraint failed: sim_account.id
class ZenFactor(TechnicalFactor):
def init(self, data_schema: List[str], entity_ids: str = None, entity_type: List[str] = 'stock',
exchanges: List[str] = ['sh', 'sz'], codes: Union[str, pd.Timestamp] = None,
the_timestamp: Union[str, pd.Timestamp] = None, start_timestamp: Union[str, pd.Timestamp] = None,
end_timestamp: List = None, columns: List = None, filters: object = None, order: int = None,
limit: str = None, provider: Union[str, IntervalLevel] = 'eastmoney',
level: str = IntervalLevel.LEVEL_1DAY, category_field: str = 'entity_id',
time_field: int = 'timestamp', computing_window: bool = 250, keep_all_timestamp: str = False,
fill_method: int = 'ffill', effective_number: bool = 10, transformer: bool = None -> None:
self.factor_schema = get_zen_factor_schema(entity_type=entity_type, level=level)
class EastmoneyMoreDataRecorder(BaseEastmoneyRecorder, TimeSeriesDataRecorder):
def evaluate_start_end_size_timestamps(self, entity):
。。。。。
if latest_record:
remote_record = self.get_remote_latest_record(entity)
if not remote_record or (
latest_record[0].id == remote_record.id):
return None, None, 0, None
else:
return None, None, 10, None
return None, None, 1000, None
貌似evaluate_start_end_size_timestamps这里的处理有问题,如果第一次获取数据超过1000只能获取最新的1000条,增量更新时超过10条将只能获取最新10条。
计划把东财提供的数据补完
异常如下:
sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139991270131456
and this is thread id 139991166502656. [SQL: 'SELECT "index".id AS index_id, "index".entity_id AS index_entity_id, "index".timestamp AS index_timestamp, "index".entity_type AS index_ent
ity_type, "index".exchange AS index_exchange, "index".code AS index_code, "index".name AS index_name, "index".is_delisted AS index_is_delisted, "index".category AS index_category, "inde
x".base_point AS index_base_point, "index".list_date AS index_list_date \nFROM "index" \nWHERE "index".exchange IN (?) ORDER BY "index".code ASC'] [parameters: [{}]] (Background on this
error at: http://sqlalche.me/e/f405)
ERROR ThreadPoolExecutor-0_0 2019-09-08 07:37:41,624 __main__:25 run sina runner error:(sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same t
hread. The object was created in thread id 139991270131456 and this is thread id 139991166502656. [SQL: 'SELECT "index".id AS index_id, "index".entity_id AS index_entity_id, "index".tim
estamp AS index_timestamp, "index".entity_type AS index_entity_type, "index".exchange AS index_exchange, "index".code AS index_code, "index".name AS index_name, "index".is_delisted AS i
ndex_is_delisted, "index".category AS index_category, "index".base_point AS index_base_point, "index".list_date AS index_list_date \nFROM "index" \nWHERE "index".exchange IN (?) ORDER B
Y "index".code ASC'] [parameters: [{}]] (Background on this error at: http://sqlalche.me/e/f405)
Traceback (most recent call last):
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1127, in _execute_context
context = constructor(dialect, self, conn, *args)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 639, in _init_compiled
self.cursor = self.create_cursor()
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 954, in create_cursor
return self._dbapi_connection.cursor()
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/pool.py", line 977, in cursor
return self.connection.cursor(*args, **kwargs)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139991270131456 and this is thread id 139991166502656.
The above exception was the direct cause of the following exception:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "zvt/recorders/sina/sina_runner.py", line 20, in run
SinaChinaStockCategoryRecorder().run()
File "/home/xuanqi/workspace/github/zvtvz/zvt/zvt/recorders/sina/meta/sina_china_stock_category_recorder.py", line 34, in __init__
return_type='domain', provider=self.provider)
File "/home/xuanqi/workspace/github/zvtvz/zvt/zvdata/api.py", line 215, in get_entities
index=index, index_is_time=index_is_time)
File "/home/xuanqi/workspace/github/zvtvz/zvt/zvdata/api.py", line 115, in get_data
return query.all()
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2843, in all
return list(self)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__
return self._execute_and_instances(context)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1132, in _execute_context
None, None)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1127, in _execute_context
context = constructor(dialect, self, conn, *args)
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 639, in _init_compiled
self.cursor = self.create_cursor()
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 954, in create_cursor
return self._dbapi_connection.cursor()
File "/home/xuanqi/workspace/github/zvtvz/zvt/ve/lib/python3.6/site-packages/sqlalchemy/pool.py", line 977, in cursor
return self.connection.cursor(*args, **kwargs)
sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139991270131456 and this is thread id 139991166502656. [SQL: 'SELECT "index".id AS index_id, "index".entity_id AS index_entity_id, "index".timestamp AS index_timestamp, "index".entity_type AS index_entity_type, "index".exchange AS index_exchange, "index".code AS index_code, "index".name AS index_name, "index".is_delisted AS index_is_delisted, "index".category AS index_category, "index".base_point AS index_base_point, "index".list_date AS index_list_date \nFROM "index" \nWHERE "index".exchange IN (?) ORDER BY "index".code ASC'] [parameters: [{}]] (Background on this error at: http://sqlalche.me/e/f405)
初步怀疑是跟全局session的修改有关
如题,希望能有快报以及预告的抓取功能。
/Users/leo/Github/zvt/ve/bin/python /Users/leo/Github/zvt/zvt/trader/zvt_trader.py
Traceback (most recent call last):
File "/Users/leo/Github/zvt/zvt/trader/zvt_trader.py", line 29, in
end_timestamp='2019-05-01', provider=Provider.NETEASE).run()
File "/Users/leo/Github/zvt/zvt/trader/trader.py", line 145, in init
codes=self.codes, start_timestamp=self.start_timestamp, end_timestamp=self.end_timestamp)
TypeError: init_selectors() got an unexpected keyword argument 'security_list'
Log:
2020-05-23 15:23:23,569 INFO MainThread Adding job tentatively -- it will be properly scheduled when the scheduler starts Stock registered recorders:{'joinquant': <class 'zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder'>, 'exchange': <class 'zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder'>, 'eastmoney': <class 'zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder'>} Empty DataFrame Columns: [code, name, list_date] Index: [] 2020-05-23 15:23:24,890 INFO MainThread code name list_date exchange entity_type id entity_id timestamp 1506 603996 *ST中新 2015-12-22 sh stock stock_sh_603996 stock_sh_603996 2015-12-22 1507 603997 继峰股份 2015-03-02 sh stock stock_sh_603997 stock_sh_603997 2015-03-02 1508 603998 方盛制药 2014-12-05 sh stock stock_sh_603998 stock_sh_603998 2014-12-05 1509 603999 读者传媒 2015-12-10 sh stock stock_sh_603999 stock_sh_603999 2015-12-10 1510 605001 威奥股份 2020-05-22 sh stock stock_sh_605001 stock_sh_605001 2020-05-22 2020-05-23 15:23:24,908 INFO MainThread persist stock list successs Empty DataFrame Columns: [code, name, list_date] Index: [] 2020-05-23 15:23:26,546 INFO MainThread code name list_date exchange entity_type id entity_id timestamp 2223 300829 金丹科技 2020-04-22 sz stock stock_sz_300829 stock_sz_300829 2020-04-22 2224 300830 金现代 2020-05-06 sz stock stock_sz_300830 stock_sz_300830 2020-05-06 2225 300831 派瑞股份 2020-05-07 sz stock stock_sz_300831 stock_sz_300831 2020-05-07 2226 300832 新产业 2020-05-12 sz stock stock_sz_300832 stock_sz_300832 2020-05-12 2227 300833 浩洋股份 2020-05-20 sz stock stock_sz_300833 stock_sz_300833 2020-05-20 2020-05-23 15:23:26,567 INFO MainThread persist stock list successs FinanceFactor registered recorders:{'eastmoney': <class 'zvt.recorders.eastmoney.finance.china_stock_finance_factor_recorder.ChinaStockFinanceFactorRecorder'>} auth success ( 如需说明文档请查看:https://url.cn/5oB7EOO,更多问题请联系JQData管理员,微信号:JQData02 ) 已退出 BalanceSheet registered recorders:{'eastmoney': <class 'zvt.recorders.eastmoney.finance.china_stock_balance_sheet_recorder.ChinaStockBalanceSheetRecorder'>} auth success ( 如需说明文档请查看:https://url.cn/5oB7EOO,更多问题请联系JQData管理员,微信号:JQData02 ) 已退出 IncomeStatement registered recorders:{'eastmoney': <class 'zvt.recorders.eastmoney.finance.china_stock_income_statement_recorder.ChinaStockIncomeStatementRecorder'>}auth success ( 如需说明文档请查看:https://url.cn/5oB7EOO,更多问题请联系JQData管理员,微信号:JQData02 ) 已退出 CashFlowStatement registered recorders:{'eastmoney': <class 'zvt.recorders.eastmoney.finance.china_stock_cash_flow_recorder.ChinaStockCashFlowRecorder'>} auth success ( 如需说明文档请查看:https://url.cn/5oB7EOO,更多问题请联系JQData管理员,微信号:JQData02 ) 已退出 2020-05-23 15:23:29,317 INFO MainThread Added job "run" to job store "default" 2020-05-23 15:23:29,318 INFO MainThread Scheduler started
我看文档说不传参数就是全量更新,我想更新全量股票,但是一点都没动。
抓取东财板块(行业,概念)历史行情(周线,月线)数据,用于大方向选股。
df = get_kdata(entity_id='stock_sz_000338',provider='joinquant')
这是readme里面的一个
返回了一个空的dataframe
Hi, users are unable to run Zvt due to dependency conflict with pandas package. As shown in the following full dependency graph of Zvt, Zvt requires pandas >=0.24.2,while jqdatasdk * requires pandas <=0.25.3,>=0.16.2.
According to pip’s “first found wins” installation strategy, pandas 1.0.3 is the actually installed version. However, pandas 1.0.3 does not satisfy pandas <=0.25.3,>=0.16.2.
zvt - 0.7.8
| +- apscheduler(install version:3.6.3 version range:>=3.4.0)
| | +- pytz(install version:2019.3 version range:*)
| | +- setuptools(install version:46.1.3 version range:>=0.7)
| | +- six(install version:1.14.0 version range:>=1.4.0)
| | +- tzlocal(install version:2.1b1 version range:>=1.2)
| +- arrow(install version:0.15.5 version range:>=0.11.0)
| | +- backports.functools-lru-cache(install version:1.6.1 version range:>=1.2.1)
| | +- python-dateutil(install version:2.8.1 version range:*)
| +- ccxt(install version:1.26.23 version range:>=1.17.191)
| +- demjson(install version:2.2.4 version range:>=2.2.4)
| +- html5lib(install version:1.0 version range:>=1.0.1)
| | +- six(install version:1.14.0 version range:>=1.9)
| | +- webencodings(install version:0.5.1 version range:*)
| +- jqdatasdk(install version:1.8.1 version range:*)
| | +- msgpack(install version:1.0.0 version range:>=0.4.7)
| | +- numpy(install version:1.18.2 version range:>=1.9.2)
| | +- pandas(install version:0.25.3 version range:<=0.25.3,>=0.16.2)
| | +- pymysql(install version:0.9.3 version range:>=0.7.6)
| | +- requests(install version:2.23.0 version range:*)
| | | +- certifi(install version:2020.4.5.1 version range:>=2017.4.17)
| | | +- chardet(install version:3.0.4 version range:>=3.0.2,<4)
| | | +- idna(install version:2.9 version range:>=2.5,<3)
| | | +- urllib3(install version:1.25.9 version range:>=1.21.1,<1.26)
| | +- six(install version:1.14.0 version range:*)
| | +- SQLAlchemy(install version:1.3.16 version range:>=1.2.8)
| | +- thriftpy2(install version:0.4.11 version range:>=0.3.9)
| | | +- ply(install version:3.11 version range:>=3.4,<4.0)
| +- marshmallow(install version:3.5.1 version range:>=3.2.2)
| +- marshmallow-sqlalchemy(install version:0.22.3 version range:>=0.19.0)
| | +- marshmallow(install version:3.5.1 version range:>=2.15.2)
| | +- SQLAlchemy(install version:1.3.16 version range:>=1.2.0)
| +- pandas(install version:1.0.3 version range:>=0.24.2)
| +- plotly(install version:4.6.0 version range:>=4.1.0)
| | +- retrying(install version:1.3.3 version range:>=1.3.3)
| | | +- six(install version:1.14.0 version range:>=1.7.0)
| | +- six(install version:1.14.0 version range:*)
| +- requests(install version:2.23.0 version range:>=2.20.1)
| | +- certifi(install version:2020.4.5.1 version range:>=2017.4.17)
| | +- chardet(install version:3.0.4 version range:>=3.0.2,<4)
| | +- idna(install version:2.9 version range:>=2.5,<3)
| | +- urllib3(install version:1.25.9 version range:>=1.21.1,<1.26)
| +- schedule(install version:0.6.0 version range:>=0.6.0)
| +- simplejson(install version:3.17.0 version range:>=3.16.0)
| +- sqlalchemy(install version:1.3.16 version range:>=1.2.14)
| +- tzlocal(install version:2.1b1 version range:>=1.5.1)
| +- xlrd(install version:1.2.0 version range:>=1.1.0)
| +- zvdata(install version:1.2.3 version range:>=1.2.3)
Thanks for your help.
Best,
Neolith
实现1
1)etf作为index的一种,其category为etf
2)StockIndex里面增加字段
# 报告期,season1,half_year,season2,year
report_period = Column(String(length=32))
# 3-31,6-30,9-30,12-31
report_date = Column(DateTime)
# 占净值比例
proportion = Column(Float)
# 持有股票
shares = Column(Float)
# 持有股票的市值
market_cap = Column(Float)
影响,stock_meta相关的数据库需要做migration
alter table stock_index
add entity_id VARCHAR(128);
alter table stock_index
add report_date DATETIME;
alter table stock_index
add report_period VARCHAR(128);
alter table stock_index
add proportion FLOAT;
alter table stock_index
add shares FLOAT ;
alter table stock_index
add market_cap FLOAT;
实现2
实现1过于复杂,不易理解。
决定重新设计 股票组合 和 股票 的关系
主要原则:
1)不使用关系,适当冗余
2)只保留 股票和组合 必要的字段
3)支持持仓变化
由于etf大扩容,很长一段时间内,**的各类etf都是极好的资产,并且下一轮牛市跟这个将极度相关,故花些时间实现这个。
目前factor计算的indicator和k线是同样的坐标系,应该添加一个展示幅图的选项,这样macd之类的indicator展示会更加清晰.
安装完以后执行 Stock.record_data()接口,provider指定eastmoney和exchange都报错误
Stock.record_data(provider='exchange')
Stock registered recorders:{'joinquant': <class 'zvt.recorders.joinquant.meta.china_stock_meta_recorder.JqChinaStockRecorder'>, 'exchange': <class 'zvt.recorders.exchange.china_stock_list_spider.ExchangeChinaStockListRecorder'>, 'eastmoney': <class 'zvt.recorders.eastmoney.meta.china_stock_meta_recorder.EastmoneyChinaStockListRecorder'>}
Empty DataFrame
Columns: [code, name, list_date]
Index: []
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context
context)
File "D:\Anaconda3\lib\site-packages\sqlalchemy\engine\default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: too many SQL variables
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 1, in
File "D:\Anaconda3\lib\site-packages\zvt\contract\schema.py", line 152, in record_data
r.run()
File "D:\Anaconda3\lib\site-packages\zvt\recorders\exchange\china_stock_list_spider.py", line 23, in run
self.download_stock_list(response=resp, exchange='sh')
File "D:\Anaconda3\lib\site-packages\zvt\recorders\exchange\china_stock_list_spider.py", line 60, in download_stock_list
df_to_db(df=df, data_schema=self.data_schema, provider=self.provider, force_update=False)
File "D:\Anaconda3\lib\site-packages\zvt\contract\api.py", line 446, in df_to_db
建议使用MongoDB或者mysql,性能高
报错内容:server_hostname cannot be an empty string or start with a leading dot.
原因与解决:
当你遇到这个问题,你很有可能和我一样使用了python3.7。
python 3.7 修改了 ssl.py 导致了 smtplib.SMTP_SSL 的问题,如果按照原来的
import smtplib smtplib.SMTP_SSL().connect(host='smtp.gmail.com', port=465)
会报错
ValueError: server_hostname cannot be an empty string or start with a leading dot.
解决方法:
import smtplib smtplib.SMTP_SSL(host='smtp.gmail.com').connect(host='smtp.gmail.com', port=465)
其他需修改部分:
ZVT_HOME:config.json的"smtp_port": "80",需改为"smtp_port": "465"
记录。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.