-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: 03d0d8d
- Loading branch information
Showing
14 changed files
with
131 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
from zvt.recorders.common.init_data import init_main_index | ||
|
||
init_main_index() | ||
|
||
from zvt.recorders.common import * | ||
from zvt.recorders.ccxt import * | ||
from zvt.recorders.eastmoney import * | ||
from zvt.recorders.exchange import * | ||
from zvt.recorders.joinquant import * | ||
from zvt.recorders.sina import * |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import pandas as pd | ||
|
||
from zvdata.api import persist_entities | ||
from zvdata.utils.time_utils import to_pd_timestamp | ||
from zvt.recorders.exchange.china_etf_list_spider import * | ||
from zvt.recorders.exchange.china_index_list_spider import * | ||
from zvt.recorders.exchange.china_stock_list_spider import * | ||
|
||
CHINA_STOCK_MAIN_INDEX = [{'id': 'index_cn_000001', | ||
'entity_id': 'index_cn_000001', | ||
'code': '000001', | ||
'name': '上证指数', | ||
'timestamp': '1990-12-19', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_000016', | ||
'entity_id': 'index_cn_000016', | ||
'code': '000016', | ||
'name': '上证50', | ||
'timestamp': '2004-01-02', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_000905', | ||
'entity_id': 'index_cn_000905', | ||
'code': '000905', | ||
'name': '中证500', | ||
'timestamp': '2005-01-04', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_399001', | ||
'entity_id': 'index_cn_399001', | ||
'code': '399001', | ||
'name': '深证成指', | ||
'timestamp': '1991-04-03', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_399106', | ||
'entity_id': 'index_cn_399106', | ||
'code': '399106', | ||
'name': '深证综指', | ||
'timestamp': '1991-04-03', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_399300', | ||
'entity_id': 'index_cn_399300', | ||
'code': '399300', | ||
'name': '沪深300', | ||
'timestamp': '2002-01-04', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_399005', | ||
'entity_id': 'index_cn_399005', | ||
'code': '399005', | ||
'name': '中小板指', | ||
'timestamp': '2006-01-24', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_399006', | ||
'entity_id': 'index_cn_399006', | ||
'code': '399006', | ||
'name': '创业板指', | ||
'timestamp': '2010-06-01', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
# # 聚宽编码 | ||
# # 市场通编码 市场通名称 | ||
# # 310001 沪股通 | ||
# # 310002 深股通 | ||
# # 310003 港股通(沪) | ||
# # 310004 港股通(深) | ||
{'id': 'index_cn_310001', | ||
'entity_id': 'index_cn_310001', | ||
'code': '310001', | ||
'name': '沪股通', | ||
'timestamp': '2014-11-17', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_310002', | ||
'entity_id': 'index_cn_310002', | ||
'code': '310002', | ||
'name': '深股通', | ||
'timestamp': '2014-11-17', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_310003', | ||
'entity_id': 'index_cn_310003', | ||
'code': '310003', | ||
'name': '港股通(沪)', | ||
'timestamp': '2014-11-17', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'}, | ||
{'id': 'index_cn_310004', | ||
'entity_id': 'index_cn_310004', | ||
'code': '310004', | ||
'name': '港股通(深)', | ||
'timestamp': '2014-11-17', | ||
'exchange': 'cn', | ||
'entity_type': 'index', | ||
'category': 'main'} | ||
] | ||
|
||
|
||
def init_main_index(provider='exchange'): | ||
for item in CHINA_STOCK_MAIN_INDEX: | ||
item['timestamp'] = to_pd_timestamp(item['timestamp']) | ||
df = pd.DataFrame(CHINA_STOCK_MAIN_INDEX) | ||
# print(df) | ||
persist_entities(df, entity_type='index', provider=provider) | ||
|
||
|
||
init_main_index() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
from .sina_index_money_flow_recorder import SinaBlockMoneyFlowRecorder | ||
from .sina_block_money_flow_recorder import SinaBlockMoneyFlowRecorder | ||
from .sina_stock_money_flow_recorder import SinaStockMoneyFlowRecorder | ||
|
||
__all__ = ['SinaBlockMoneyFlowRecorder', 'SinaStockMoneyFlowRecorder'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters