Frictrade LGBMRegressor

This commit is contained in:
Jérôme Delacotte
2025-11-30 16:17:35 +01:00
parent 89abd0b4da
commit c66b9c4a8b
2 changed files with 2065 additions and 15 deletions

View File

@@ -511,15 +511,14 @@ class Frictrade(IStrategy):
dataframe.loc[
(
# (dataframe['sma5_inv'] == 1)
(
(dataframe['pct180'] < 0.5) |
(
(dataframe['close'] < dataframe['sma60'] )
& (dataframe['sma24_deriv1'] > 0)
)
)
& (dataframe['hapercent'] > 0)
& (dataframe['sma24_deriv1'] > - 0.03)
# (
# ((dataframe['pct180'] < 0.5) | (dataframe['sma24_deriv1'] > 0))
# |((dataframe['close'] < dataframe['sma24'] ) & (dataframe['sma24_deriv1'] > 0))
#
# )
(dataframe['hapercent'] > 0)
& (dataframe['rsi'] < 85)
& (dataframe['sma24'] > dataframe['sma60'])
# & (
# (dataframe['percent3'] <= -0.003)
# | (dataframe['percent12'] <= -0.003)
@@ -578,7 +577,7 @@ class Frictrade(IStrategy):
# base_size = montant de base que tu veux utiliser (ex: stake_amount ou autre)
base_size = base_stake # exemple fraction du portefeuille; adapte selon ton code
# new stake proportionnel à mult
new_stake = base_size * mult
new_stake = base_size #* mult
return new_stake
def adjust_trade_position(self, trade: Trade, current_time: datetime,
@@ -817,11 +816,11 @@ class Frictrade(IStrategy):
stake=0
)
if last_candle['sma24_deriv1'] > 0 : #and minutes < 180 and baisse < 30: # and last_candle['sma5_deriv1'] > -0.15:
if (minutes < 180):
return None
if (minutes > 1440 and last_candle['sma60_deriv1'] > 0) :
return None
# if last_candle['sma24_deriv1'] > 0 : #and minutes < 180 and baisse < 30: # and last_candle['sma5_deriv1'] > -0.15:
# if (minutes < 180):
# return None
# if (minutes > 1440 and last_candle['sma60_deriv1'] > 0) :
# return None
# ----- 4) OFFSET : faut-il attendre de dépasser trailing_stop_positive_offset ? -----