From b534dbe6573a4ad048987bab670b8159dc73fe11 Mon Sep 17 00:00:00 2001 From: admin <admin@example.com> Date: 星期二, 25 三月 2025 14:03:20 +0800 Subject: [PATCH] bug修改 --- strategy/all_K_line.py | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/strategy/all_K_line.py b/strategy/all_K_line.py index dd7071b..07d5730 100644 --- a/strategy/all_K_line.py +++ b/strategy/all_K_line.py @@ -209,8 +209,7 @@ current_count = 0 start = None # 纭繚涓嶄細鍑虹幇闄や互闆剁殑鎶ラ敊 - if current_yesterday_volume == 0: - current_yesterday_volume = 1 + if current_yesterday_volume != 0: if round(current_today_volume / current_yesterday_volume, 2) > 1.1: # print(f"i=={i} {it_K_line[i]['bob']} {round(current_today_volume/current_yesterday_volume,2)} 銆愭斁閲忋��") if current_today_growth > 0: @@ -234,17 +233,19 @@ else: it_K_line[i]['today_volume_shape'] = 'decreases_balance' # print(f"i=={i} {it_K_line[i]['bob']} 銆愮缉閲忓钩鏀躲��") - else: - # print(f"i=={i} {it_K_line[i]['bob']} {round(current_today_volume/current_yesterday_volume,2)} 銆愬钩閲忋��") - if current_today_growth > 0: - it_K_line[i]['today_volume_shape'] = 'remained_up' - # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忎笂娑ㄣ��") - elif current_today_growth < 0: - it_K_line[i]['today_volume_shape'] = 'remained_down' - # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忎笅璺屻��") else: - it_K_line[i]['today_volume_shape'] = 'remained_balance' - # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忓钩鏀躲��") + # print(f"i=={i} {it_K_line[i]['bob']} {round(current_today_volume/current_yesterday_volume,2)} 銆愬钩閲忋��") + if current_today_growth > 0: + it_K_line[i]['today_volume_shape'] = 'remained_up' + # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忎笂娑ㄣ��") + elif current_today_growth < 0: + it_K_line[i]['today_volume_shape'] = 'remained_down' + # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忎笅璺屻��") + else: + it_K_line[i]['today_volume_shape'] = 'remained_balance' + # print(f"i=={i} {it_K_line[i]['bob']} 銆愬钩閲忓钩鏀躲��") + else: + logger.info(f"{symbol} 鐨� 鏄ㄦ棩鎴愪氦閲� 涓� 0锛屾姤閿欙紒锛�") if current_open - previous_close > 0: # print(f"i=={i} {it_K_line[i]['bob']} 鎴愪氦鎬婚噺:{today_volume},,,鎴愪氦鎬婚噾棰�:{today_amount}") -- Gitblit v1.8.0