TEST Learning

This commit is contained in:
Jérôme Delacotte
2026-04-08 21:46:21 +02:00
parent 3302266b4a
commit a925a28389
3 changed files with 1659 additions and 272 deletions

View File

@@ -742,6 +742,10 @@ class EmptyShort(IStrategy):
dataframe["volume_mean"] = dataframe["volume"].rolling(20).mean()
dataframe["volume_ratio"] = dataframe["volume"] / dataframe["volume_mean"]
dataframe['volume2'] = dataframe['volume']
dataframe.loc[dataframe['hapercent'] < 0, 'volume2'] *= -1
dataframe['volume_spike'] = (abs(dataframe['volume2']) > abs(dataframe['volume2'].rolling(window=20).mean() * 5)) \
& (dataframe['volume'].rolling(window=5).max() > 1000)
dataframe["market_state"] = 0
@@ -874,13 +878,6 @@ class EmptyShort(IStrategy):
# Compter les baisses / hausses consécutives
dataframe = self.calculateDownAndUp(dataframe, limit=0.0001)
dataframe['volume2'] = dataframe['volume']
dataframe.loc[dataframe['hapercent'] < 0, 'volume2'] *= -1
# Volume confirmation
dataframe['volume_spike'] = (abs(dataframe['volume2']) > abs(dataframe['volume2'].rolling(window=20).mean() * 5)) \
& (dataframe['volume'].rolling(window=5).max() > 1000)
dataframe['sma5_1h'] = dataframe['sma5_1h'].rolling(window=60).mean()
# récupérer le dernier trade fermé