-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 0.9.22 start coding * 0.9.22 更新信号函数 * 0.9.22 fix cci * 0.9.22 新增几个信号函数 * 0.9.22 update * 0.9.22 新增多维表格读取接口 * 0.9.22 新增信号函数 * 0.9.22 update * 0.9.22 update * 0.9.22 更新信号函数 * 0.9.22 更新信号函数 * 0.9.22 更新一批信号函数 * 0.9.22 update signals * 0.9.22 新增EMV基础策略 * 0.9.22 新增固定止盈止损策略 * 0.9.22 fix bug: 识别笔的过程有个细节导致程序出错 * 0.9.22 update * 0.9.22 update connectors * 0.9.22 更新一批信号函数
- Loading branch information
Showing
63 changed files
with
4,067 additions
and
1,626 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
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,34 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
author: zengbin93 | ||
email: zeng_bin8888@163.com | ||
create_dt: 2023/6/24 18:49 | ||
describe: Tushare数据源 | ||
""" | ||
import os | ||
from czsc import data | ||
|
||
dc = data.TsDataCache(data_path=os.environ.get('ts_data_path', r'D:\ts_data')) | ||
|
||
|
||
def get_symbols(step): | ||
if step.upper() == 'ALL': | ||
return data.get_symbols(dc, 'index') + data.get_symbols(dc, 'stock') + data.get_symbols(dc, 'etfs') | ||
return data.get_symbols(dc, step) | ||
|
||
|
||
def get_raw_bars(symbol, freq, sdt, edt, fq='后复权', raw_bar=True): | ||
"""读取本地数据""" | ||
ts_code, asset = symbol.split("#") | ||
freq = str(freq) | ||
adj = "qfq" if fq == "前复权" else "hfq" | ||
|
||
if "分钟" in freq: | ||
freq = freq.replace("分钟", "min") | ||
bars = dc.pro_bar_minutes(ts_code, sdt=sdt, edt=edt, freq=freq, asset=asset, adj=adj, raw_bar=raw_bar) | ||
|
||
else: | ||
_map = {"日线": "D", "周线": "W", "月线": "M"} | ||
freq = _map[freq] | ||
bars = dc.pro_bar(ts_code, start_date=sdt, end_date=edt, freq=freq, asset=asset, adj=adj, raw_bar=raw_bar) | ||
return bars |
Oops, something went wrong.