From 38c36fddaa5e4ffcd16b66cf8a48f317faddcab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Delacotte?= Date: Tue, 6 May 2025 13:37:57 +0200 Subject: [PATCH] correction expectedProfit --- Zeus_8_3_2_B_4_2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Zeus_8_3_2_B_4_2.py b/Zeus_8_3_2_B_4_2.py index f37b008..5bf51b3 100644 --- a/Zeus_8_3_2_B_4_2.py +++ b/Zeus_8_3_2_B_4_2.py @@ -1073,7 +1073,9 @@ class Zeus_8_3_2_B_4_2(IStrategy): def expectedProfit(self, pair: str, last_candle: DataFrame): first_price = last_candle['first_price'] - first_max = (last_candle['max200'] - first_price) / first_price + first_max = 0.01 + if first_price < last_candle['max200']: + first_max = (last_candle['max200'] - first_price) / first_price expected_profit = min(0.01, first_max) @@ -1612,8 +1614,9 @@ class Zeus_8_3_2_B_4_2(IStrategy): if len(future_idx) < window_size: continue - future_highs = df.loc[future_idx, 'high'] + future_highs = df.loc[future_idx, 'close'] if (future_highs >= price_now * (1 + percent)).any(): + print(df.loc[future_idx]) hits += 1 total += 1