去掉trim data,修改check_fx回去
This commit is contained in:
+13
-13
@@ -1339,17 +1339,17 @@ def analyze():
|
||||
'end_price': bi.end_klc.high if convert_direction(bi.dir) == 1 else bi.end_klc.low if bi.end_klc else None,
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in analysis_result['bi_list'] if bi.end_klc],
|
||||
} for bi in analysis_result['bi_list'] if bi.is_sure],
|
||||
# 添加未完成笔列表
|
||||
'uncompleted_bi_list': [{
|
||||
'start_time': bi.start_klc.end_time if isinstance(bi.start_klc.end_time, str) else bi.start_klc.end_time.astimezone(client_tz).isoformat(),
|
||||
'end_time': None, # 未完成笔没有结束时间
|
||||
'end_time': bi.end_time, # 未完成笔没有结束时间
|
||||
'sure_time': format_time_safely(bi.sure_time, client_tz) if bi.sure_time else None,
|
||||
'start_price': bi.start_klc.low if convert_direction(bi.dir) == 1 else bi.start_klc.high,
|
||||
'end_price': None, # 未完成笔没有结束价格
|
||||
'end_price': bi.end_klc.low if convert_direction(bi.dir) == 1 else bi.end_klc.high, # 未完成笔没有结束价格
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in analysis_result['bi_list'] if not bi.end_klc],
|
||||
} for bi in analysis_result['bi_list'] if not bi.is_sure],
|
||||
'seg_list': [{
|
||||
'start_time': seg.start_bi.start_klc.end_time if isinstance(seg.start_bi.start_klc.end_time, str) else seg.start_bi.start_klc.end_time.astimezone(client_tz).isoformat(),
|
||||
'end_time': (seg.end_bi.end_klc.end_time if isinstance(seg.end_bi.end_klc.end_time, str) else seg.end_bi.end_klc.end_time.astimezone(client_tz).isoformat()) if seg.end_bi else None,
|
||||
@@ -1368,7 +1368,7 @@ def analyze():
|
||||
'gg': zs.gg,
|
||||
'dd': zs.dd,
|
||||
'is_sure': zs.is_sure # 添加中枢是否完成的标志
|
||||
} for zs in analysis_result['zs_list'] if zs.end_klc],
|
||||
} for zs in analysis_result['zs_list'] if zs.is_sure],
|
||||
# 添加主周期BI中枢列表(已完成)
|
||||
'bi_zs_list': [{
|
||||
'start_time': (
|
||||
@@ -1534,17 +1534,17 @@ def analyze():
|
||||
'end_price': bi.end_klc.high if convert_direction(bi.dir) == 1 else bi.end_klc.low if bi.end_klc else None,
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in element_analysis['bi_list'] if bi.end_klc]
|
||||
} for bi in element_analysis['bi_list'] if bi.is_sure]
|
||||
# 添加次周期未完成笔列表
|
||||
result['element_uncompleted_bi_list'] = [{
|
||||
'start_time': bi.start_klc.end_time if isinstance(bi.start_klc.end_time, str) else bi.start_klc.end_time.astimezone(client_tz).isoformat(),
|
||||
'end_time': None, # 未完成笔没有结束时间
|
||||
'end_time': bi.end_time, # 未完成笔没有结束时间
|
||||
'sure_time': format_time_safely(bi.sure_time, client_tz) if bi.sure_time else None,
|
||||
'start_price': bi.start_klc.low if convert_direction(bi.dir) == 1 else bi.start_klc.high,
|
||||
'end_price': None, # 未完成笔没有结束价格
|
||||
'end_price': bi.end_klc.low if convert_direction(bi.dir) == 1 else bi.end_klc.high, # 未完成笔没有结束价格
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in element_analysis['bi_list'] if not bi.end_klc]
|
||||
} for bi in element_analysis['bi_list'] if not bi.is_sure]
|
||||
|
||||
# 添加小周期K线数据
|
||||
result['element_kline_data'] = clean_dataframe_for_json(element_df).to_dict('records')
|
||||
@@ -1674,16 +1674,16 @@ def analyze():
|
||||
'end_price': bi.end_klc.high if convert_direction(bi.dir) == 1 else bi.end_klc.low if bi.end_klc else None,
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in sub_sub_analysis['bi_list'] if bi.end_klc]
|
||||
} for bi in sub_sub_analysis['bi_list'] if bi.is_sure]
|
||||
result['sub_sub_uncompleted_bi_list'] = [{
|
||||
'start_time': bi.start_klc.end_time if isinstance(bi.start_klc.end_time, str) else bi.start_klc.end_time.astimezone(client_tz).isoformat(),
|
||||
'end_time': None,
|
||||
'end_time': bi.end_time,
|
||||
'sure_time': format_time_safely(bi.sure_time, client_tz) if bi.sure_time else None,
|
||||
'start_price': bi.start_klc.low if convert_direction(bi.dir) == 1 else bi.start_klc.high,
|
||||
'end_price': None,
|
||||
'end_price': bi.end_klc.low if convert_direction(bi.dir) == 1 else bi.end_klc.high,
|
||||
'direction': convert_direction(bi.dir),
|
||||
'macd_div': float(bi.macd_div) if hasattr(bi, 'macd_div') else 0
|
||||
} for bi in sub_sub_analysis['bi_list'] if not bi.end_klc]
|
||||
} for bi in sub_sub_analysis['bi_list'] if not bi.is_sure]
|
||||
# 次次周期 KLC 列表
|
||||
result['sub_sub_klc_list'] = [{
|
||||
'date': klc.end_time if isinstance(klc.end_time, str) else klc.end_time.astimezone(client_tz).isoformat(),
|
||||
|
||||
Reference in New Issue
Block a user