添加一些东西

This commit is contained in:
jackyu66git
2025-06-27 02:40:14 +08:00
parent de756e38eb
commit 68ecb4343e
3 changed files with 196 additions and 23 deletions
+7 -4
View File
@@ -127,7 +127,7 @@ def get_crypto_kl_data(symbol, timeframe, limit=1000, start_time=None, end_time=
batch_size = 1200 # 小时级数据可以获取更多
else:
batch_size = 1500 # 日线及以上可以获取更多
batch_size = 1000
# 初始化存储所有K线数据的列表
all_ohlcv = []
@@ -370,13 +370,14 @@ def analyze_chan(df, timeframe='1d'):
"divergence_rate": float("inf"),
"bsp2_follow_1": False,
"bsp3_follow_1": False,
"min_zs_cnt": 0,
"min_zs_cnt": 1,
"bs1_peak": False,
"macd_algo": "peak",
"bs_type": '1,2,3a,1p,2s,3b',
"print_warning": True, # 开启警告以便调试
"zs_algo": "normal", # 使用标准中枢算法提高稳定性 over_seg, normal, auto
"bi_algo": "normal",
"seg_algo": "chan",
})
# 将数据设置到WebDataAPI
from DataAPI.WebDataAPI import WebDataAPI
@@ -471,8 +472,10 @@ def analyze_chan(df, timeframe='1d'):
# 只在数据量较少时打印分析结果摘要,避免在回放时产生过多日志
if len(df) <= 50:
print(f"chan.py分析完成: 笔{len(bi_list)}个, 线段{len(seg_list)}个, 中枢{len(zs_list)}个, 买卖点{len(buy_sell_points)}")
#last_seg = seg_list[-2]
#last_bi = last_seg.end_bi
#last_klu = last_bi.get_end_klu()
#print(last_klu.time, last_seg.is_sure, last_seg.dir, "--------------------------------")
return {
'klc_list': kline_list.lst if hasattr(kline_list, 'lst') else [],
'klu_list': [], # KLU数据在klc中