tendance sur 3 heures 3 jours
This commit is contained in:
@@ -491,7 +491,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# normalized_close = self.min_max_scaling(dataframe['close'])
|
# normalized_close = self.min_max_scaling(dataframe['close'])
|
||||||
################### INFORMATIVE 1h
|
################### INFORMATIVE 1h
|
||||||
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe="1h")
|
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe="1h")
|
||||||
informative = self.calculateTendency(informative)
|
informative = self.calculateTendency(informative, 3)
|
||||||
informative['volatility'] = talib.STDDEV(informative['close'], timeperiod=14) / informative['close']
|
informative['volatility'] = talib.STDDEV(informative['close'], timeperiod=14) / informative['close']
|
||||||
informative['atr'] = (talib.ATR(informative['high'], informative['low'], informative['close'], timeperiod=14)) / informative['close']
|
informative['atr'] = (talib.ATR(informative['high'], informative['low'], informative['close'], timeperiod=14)) / informative['close']
|
||||||
informative['rsi'] = talib.RSI(informative['close'], length=7)
|
informative['rsi'] = talib.RSI(informative['close'], length=7)
|
||||||
@@ -504,7 +504,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
|
|
||||||
################### INFORMATIVE 1d
|
################### INFORMATIVE 1d
|
||||||
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe="1d")
|
informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe="1d")
|
||||||
informative = self.calculateTendency(informative)
|
informative = self.calculateTendency(informative, 3)
|
||||||
|
|
||||||
informative['rsi'] = talib.RSI(informative['close'], length=7)
|
informative['rsi'] = talib.RSI(informative['close'], length=7)
|
||||||
informative['rsi_diff'] = informative['rsi'].diff()
|
informative['rsi_diff'] = informative['rsi'].diff()
|
||||||
@@ -645,10 +645,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
|
|
||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
def calculateTendency(self, dataframe):
|
def calculateTendency(self, dataframe, window=12):
|
||||||
dataframe['mid'] = dataframe['open'] + (dataframe['close'] - dataframe['open']) / 2
|
dataframe['mid'] = dataframe['open'] + (dataframe['close'] - dataframe['open']) / 2
|
||||||
# 2. Calcul du lissage sur 200 bougies par moyenne mobile médiane
|
# 2. Calcul du lissage sur 200 bougies par moyenne mobile médiane
|
||||||
dataframe['mid_smooth'] = dataframe['mid'].rolling(window=12, center=True, min_periods=1).median().rolling(
|
dataframe['mid_smooth'] = dataframe['mid'].rolling(window=window, center=True, min_periods=1).median().rolling(
|
||||||
3).mean()
|
3).mean()
|
||||||
# 2. Dérivée première = différence entre deux bougies successives
|
# 2. Dérivée première = différence entre deux bougies successives
|
||||||
dataframe['mid_smooth_deriv1'] = dataframe['mid_smooth'].diff()
|
dataframe['mid_smooth_deriv1'] = dataframe['mid_smooth'].diff()
|
||||||
|
|||||||
Reference in New Issue
Block a user