1 Star 3 Fork 2

无聊开发/chan.py

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.py 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
Vespa314 提交于 2023-12-30 15:11 . fix: typo of trigger
from Chan import CChan
from ChanConfig import CChanConfig
from Common.CEnum import AUTYPE, DATA_SRC, KL_TYPE
from Plot.AnimatePlotDriver import CAnimateDriver
from Plot.PlotDriver import CPlotDriver
if __name__ == "__main__":
code = "sz.000001"
begin_time = "2018-01-01"
end_time = None
data_src = DATA_SRC.BAO_STOCK
lv_list = [KL_TYPE.K_DAY]
config = CChanConfig({
"bi_strict": True,
"trigger_step": False,
"skip_step": 0,
"divergence_rate": float("inf"),
"bsp2_follow_1": False,
"bsp3_follow_1": False,
"min_zs_cnt": 0,
"bs1_peak": False,
"macd_algo": "peak",
"bs_type": '1,2,3a,1p,2s,3b',
"print_warning": True,
"zs_algo": "normal",
})
plot_config = {
"plot_kline": True,
"plot_kline_combine": True,
"plot_bi": True,
"plot_seg": True,
"plot_eigen": False,
"plot_zs": True,
"plot_macd": False,
"plot_mean": False,
"plot_channel": False,
"plot_bsp": True,
"plot_extrainfo": False,
"plot_demark": False,
"plot_marker": False,
"plot_rsi": False,
"plot_kdj": False,
}
plot_para = {
"seg": {
# "plot_trendline": True,
},
"bi": {
# "show_num": True,
# "disp_end": True,
},
"figure": {
"x_range": 200,
},
"marker": {
# "markers": { # text, position, color
# '2023/06/01': ('marker here', 'up', 'red'),
# '2023/06/08': ('marker here', 'down')
# },
}
}
chan = CChan(
code=code,
begin_time=begin_time,
end_time=end_time,
data_src=data_src,
lv_list=lv_list,
config=config,
autype=AUTYPE.QFQ,
)
if not config.trigger_step:
plot_driver = CPlotDriver(
chan,
plot_config=plot_config,
plot_para=plot_para,
)
plot_driver.figure.show()
else:
CAnimateDriver(
chan,
plot_config=plot_config,
plot_para=plot_para,
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/boring-development/chan.py.git
git@gitee.com:boring-development/chan.py.git
boring-development
chan.py
chan.py
main

搜索帮助