- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathincre.py
More file actions
Latest commit
25 lines (18 loc) · 576 Bytes
/
Copy pathincre.py
File metadata and controls
25 lines (18 loc) · 576 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
importlogging
fromib_insyncimportIB
fromconfig.configimportConfig
fromincre.crawlimportCrawl
fromincre.calimportCal
if__name__=='__main__':
# 记录 IB 接口及其他错误信息
logging.basicConfig(filename='logs/incre/error.log', level=logging.ERROR)
ib=IB()
ib.connect(Config.ib_host, Config.ib_port, Config.ib_client_id)
# 增量爬取数据
c=Crawl(ib)
c.crawl_codes_data() # 爬取 stock 数据
c.crawl_index_data() # 爬取 HSI 数据
ib.disconnect()
# 增量计算数据
ca=Cal()
ca.main()