From 3efc95e4159c3f9b9ac189a985606b5b6c9cf0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Delacotte?= Date: Thu, 4 Dec 2025 19:12:59 +0100 Subject: [PATCH] FIX ISSUES --- FrictradeLearning.py | 3 ++- GodStraJD3_3.py | 2 +- GodStraJD3_6_53.py | 2 +- GodStraJD3_6_53_1.py | 2 +- GodStraJD3_9.py | 2 +- Ishimoku_6.py | 4 ++-- Solipsis5.py | 6 +++--- Supertrend.py | 2 +- Zeus_5_1.py | 4 ++-- Zeus_5_2.py | 4 ++-- Zeus_6.py | 4 ++-- Zeus_8_3_2_B_4_2.py | 28 ++++++++++++++-------------- fixed_riskreward_loss.py | 2 +- 13 files changed, 33 insertions(+), 32 deletions(-) diff --git a/FrictradeLearning.py b/FrictradeLearning.py index 237cd25..2f555fa 100644 --- a/FrictradeLearning.py +++ b/FrictradeLearning.py @@ -1061,7 +1061,8 @@ class FrictradeLearning(IStrategy): # FIN ########################## ALGO ATH condition = last_candle['hapercent'] > 0 and last_candle['sma24_deriv1'] > 0 \ - and last_candle['close'] < self.pairs[pair]['first_buy'] and last_candle['ml_prob'] > 0.65 + and last_candle['close'] < self.pairs[pair]['first_buy'] \ + and last_candle['ml_prob'] > 0.65 limit_buy = 40 # or (last_candle['close'] <= last_candle['min180'] and hours > 3) if (decline >= dca_threshold) and condition: diff --git a/GodStraJD3_3.py b/GodStraJD3_3.py index 8d361f1..0317d17 100644 --- a/GodStraJD3_3.py +++ b/GodStraJD3_3.py @@ -10,7 +10,7 @@ from freqtrade.persistence import Trade from freqtrade.strategy.parameters import CategoricalParameter, DecimalParameter from numpy.lib import math -from freqtrade.strategy.interface import IStrategy, SellCheckTuple +from freqtrade.strategy.interface import IStrategy from pandas import DataFrame # -------------------------------- diff --git a/GodStraJD3_6_53.py b/GodStraJD3_6_53.py index 9334487..6db60c2 100644 --- a/GodStraJD3_6_53.py +++ b/GodStraJD3_6_53.py @@ -10,7 +10,7 @@ from freqtrade.persistence import Trade from freqtrade.strategy.parameters import CategoricalParameter, DecimalParameter, IntParameter from numpy.lib import math -from freqtrade.strategy.interface import IStrategy, SellCheckTuple +from freqtrade.strategy.interface import IStrategy from pandas import DataFrame # -------------------------------- diff --git a/GodStraJD3_6_53_1.py b/GodStraJD3_6_53_1.py index 4a4a5b2..764a1a9 100644 --- a/GodStraJD3_6_53_1.py +++ b/GodStraJD3_6_53_1.py @@ -10,7 +10,7 @@ from freqtrade.persistence import Trade from freqtrade.strategy.parameters import CategoricalParameter, DecimalParameter, IntParameter from numpy.lib import math -from freqtrade.strategy.interface import IStrategy, SellCheckTuple +from freqtrade.strategy.interface import IStrategy from pandas import DataFrame # -------------------------------- diff --git a/GodStraJD3_9.py b/GodStraJD3_9.py index 18ce8ae..5c57829 100644 --- a/GodStraJD3_9.py +++ b/GodStraJD3_9.py @@ -27,7 +27,7 @@ import numpy as np from random import shuffle # TODO: this gene is removed 'MAVP' cuz or error on periods -import user_data.strategies.custom_indicators as csa +# import user_data.strategies.custom_indicators as csa all_god_genes = { 'Overlap Studies': { diff --git a/Ishimoku_6.py b/Ishimoku_6.py index 8821562..633b8ce 100644 --- a/Ishimoku_6.py +++ b/Ishimoku_6.py @@ -220,10 +220,10 @@ class Ishimoku_6(IStrategy): def bot_loop_start(self, **kwargs) -> None: inf_tf = '5m' pairs = self.dp.current_whitelist() - print("Calcul des pairs informatives") + # print("Calcul des pairs informatives") for pairname in pairs: self.stop_buying[pairname] = True - print("Fin Calcul des pairs informatives") + # print("Fin Calcul des pairs informatives") # def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float, # proposed_stake: float, min_stake: float, max_stake: float, diff --git a/Solipsis5.py b/Solipsis5.py index d9a7c38..2687c1b 100644 --- a/Solipsis5.py +++ b/Solipsis5.py @@ -1,7 +1,7 @@ import numpy as np import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib -import arrow +# import arrow from freqtrade.strategy import (IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter) @@ -162,7 +162,7 @@ def SSLChannels(dataframe, length=10, mode='sma'): df['smaLow'] = df['low'].rolling(length).mean() df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, - np.where(df['close'] < df['smaLow'], -1, np.NAN)) + np.where(df['close'] < df['smaLow'], -1, np.nan)) df['hlv'] = df['hlv'].ffill() df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow']) @@ -180,7 +180,7 @@ def SSLChannels_ATR(dataframe, length=7): df['ATR'] = ta.ATR(df, timeperiod=14) df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR'] df['smaLow'] = df['low'].rolling(length).mean() - df['ATR'] - df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN)) + df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.nan)) df['hlv'] = df['hlv'].ffill() df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow']) df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh']) diff --git a/Supertrend.py b/Supertrend.py index cfc0679..8c895a7 100644 --- a/Supertrend.py +++ b/Supertrend.py @@ -164,7 +164,7 @@ class Supertrend(IStrategy): df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] >= df['final_lb'].iat[i] else \ df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] < df['final_lb'].iat[i] else 0.00 # Mark the trend direction up/down - df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down', 'up'), np.NaN) + df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down', 'up'), np.nan) # Remove basic and final bands from the columns df.drop(['basic_ub', 'basic_lb', 'final_ub', 'final_lb'], inplace=True, axis=1) diff --git a/Zeus_5_1.py b/Zeus_5_1.py index 443bc82..5eecc74 100644 --- a/Zeus_5_1.py +++ b/Zeus_5_1.py @@ -487,10 +487,10 @@ class Zeus_5_1(IStrategy): def bot_loop_start(self, **kwargs) -> None: inf_tf = '5m' pairs = self.dp.current_whitelist() - print("Calcul des pairs informatives") + # print("Calcul des pairs informatives") for pairname in pairs: self.stop_buying[pairname] = True - print("Fin Calcul des pairs informatives") + # print("Fin Calcul des pairs informatives") def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: datetime, entry_tag: Optional[str], **kwargs) -> bool: diff --git a/Zeus_5_2.py b/Zeus_5_2.py index 1908c26..fefa0f0 100644 --- a/Zeus_5_2.py +++ b/Zeus_5_2.py @@ -491,10 +491,10 @@ class Zeus_5_2(IStrategy): def bot_loop_start(self, **kwargs) -> None: inf_tf = '5m' pairs = self.dp.current_whitelist() - print("Calcul des pairs informatives") + # print("Calcul des pairs informatives") for pairname in pairs: self.stop_buying[pairname] = True - print("Fin Calcul des pairs informatives") + # print("Fin Calcul des pairs informatives") def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: datetime, entry_tag: Optional[str], **kwargs) -> bool: diff --git a/Zeus_6.py b/Zeus_6.py index 49799f1..d3baaff 100644 --- a/Zeus_6.py +++ b/Zeus_6.py @@ -487,10 +487,10 @@ class Zeus_6(IStrategy): def bot_loop_start(self, **kwargs) -> None: inf_tf = '5m' pairs = self.dp.current_whitelist() - print("Calcul des pairs informatives") + # print("Calcul des pairs informatives") for pairname in pairs: self.stop_buying[pairname] = True - print("Fin Calcul des pairs informatives") + # print("Fin Calcul des pairs informatives") def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: datetime, entry_tag: Optional[str], **kwargs) -> bool: diff --git a/Zeus_8_3_2_B_4_2.py b/Zeus_8_3_2_B_4_2.py index 041b11b..e36a547 100644 --- a/Zeus_8_3_2_B_4_2.py +++ b/Zeus_8_3_2_B_4_2.py @@ -1084,23 +1084,23 @@ class Zeus_8_3_2_B_4_2(IStrategy): dataframe['stop_buying'] = latched - if self.dp.runmode.value in ('backtest'): + if False and self.dp.runmode.value in ('backtest'): self.trainModel(dataframe, metadata) short_pair = self.getShortName(pair) - if short_pair == 'BTC': - self.model = joblib.load(f"{short_pair}_rf_model.pkl") - - # Préparer les features pour la prédiction - features = dataframe[self.model_indicators].fillna(0) - - # Prédiction : probabilité que le prix monte - probs = self.model.predict_proba(features)[:, 1] - - # Sauvegarder la probabilité pour l’analyse - dataframe['ml_prob'] = probs - - self.inspect_model(self.model) + # if short_pair == 'BTC': + # self.model = joblib.load(f"{short_pair}_rf_model.pkl") + # + # # Préparer les features pour la prédiction + # features = dataframe[self.model_indicators].fillna(0) + # + # # Prédiction : probabilité que le prix monte + # probs = self.model.predict_proba(features)[:, 1] + # + # # Sauvegarder la probabilité pour l’analyse + # dataframe['ml_prob'] = probs + # + # self.inspect_model(self.model) return dataframe diff --git a/fixed_riskreward_loss.py b/fixed_riskreward_loss.py index 1a8d9fc..1da4d89 100644 --- a/fixed_riskreward_loss.py +++ b/fixed_riskreward_loss.py @@ -48,7 +48,7 @@ class FixedRiskRewardLoss(IStrategy): # using current_time/open_date directly via custom_info_pair[trade.open_daten] # would only work in backtesting/hyperopt. # in live/dry-run, we have to search for nearest row before it - open_date_mask = custom_info_pair.index.unique().get_loc(trade.open_date_utc, method='ffill') + open_date_mask = custom_info_pair.index.unique().get_loc(trade.open_date_utc) open_df = custom_info_pair.iloc[open_date_mask] # trade might be open too long for us to find opening candle