添加连续跳空和分立跳空图
This commit is contained in:
+16
-1
@@ -378,6 +378,7 @@ def analyze_chan(df):
|
||||
'seg_list': chan_macd.seg_list,
|
||||
'unittf_list': chan_macd.unittf_list,
|
||||
'histset_list': chan_macd.histset_list,
|
||||
'klu_list': chan_macd.klu_list,
|
||||
'high_position_list': chan_macd.high_position_list,
|
||||
'high_empty_list': chan_macd.high_empty_list,
|
||||
'low_position_list': getattr(chan_macd, 'low_position_list', []),
|
||||
@@ -1048,7 +1049,9 @@ def serialize_chan_macd_data(chan_macd_data, client_tz):
|
||||
'low_empty_list': [],
|
||||
'return_zero_list': [],
|
||||
'cross0_up_list': [],
|
||||
'cross0_down_list': []
|
||||
'cross0_down_list': [],
|
||||
# 新增:输出KLU的继续背驰/分离背驰标志
|
||||
'klu_list': []
|
||||
}
|
||||
|
||||
# 序列化seg_list
|
||||
@@ -1237,6 +1240,18 @@ def serialize_chan_macd_data(chan_macd_data, client_tz):
|
||||
except Exception as e:
|
||||
print(f"序列化cross0_down出错: {e}")
|
||||
continue
|
||||
|
||||
# 序列化 KLU 列表(仅导出需要的时间与背驰标志)
|
||||
for klu in chan_macd_data.get('klu_list', []):
|
||||
try:
|
||||
serialized_data['klu_list'].append({
|
||||
'time': format_time_safely(getattr(klu, 'time', None), client_tz),
|
||||
'continue_div': bool(getattr(klu, 'continue_div', False)),
|
||||
'separate_div': bool(getattr(klu, 'separate_div', False))
|
||||
})
|
||||
except Exception as e:
|
||||
print(f"序列化klu出错: {e}")
|
||||
continue
|
||||
|
||||
return serialized_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user