Nouveaux index / smooth sur Heikin Ashi
This commit is contained in:
@@ -376,7 +376,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
self.pairs[pair]['last_candle'] = last_candle
|
||||
self.pairs[pair]['count_of_buys'] = 1
|
||||
self.pairs[pair]['current_profit'] = 0
|
||||
self.pairs[pair]['last_palier_index'] = 0
|
||||
self.pairs[pair]['last_palier_index'] = -1
|
||||
dispo = round(self.wallets.get_available_stake_amount())
|
||||
self.printLineLog()
|
||||
|
||||
@@ -576,7 +576,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
f"| {date:<16} | {action:<10} | {pair[0:3]:<3} | {trade_type or '-':<18} |{rate or '-':>9}| {dispo or '-':>6} "
|
||||
f"| {profit or '-':>8} | {pct_max or '-':>6} | {round(self.pairs[pair]['max_touch'], 2) or '-':>11} | {last_lost or '-':>12} "
|
||||
f"| {int(self.pairs[pair]['last_max']) or '-':>7} |{buys or '-':>2}-{self.pairs[pair]['last_palier_index'] or '-':>2}|{stake or '-':>7}"
|
||||
f"|{last_candle['tendency'] or '-':>3}|" #{last_candle['tendency_1h'] or '-':>3}|{last_candle['tendency_1d'] or '-':>3}"
|
||||
f"|{last_candle['tendency_12'] or '-':>3}|" #{last_candle['tendency_1h'] or '-':>3}|{last_candle['tendency_1d'] or '-':>3}"
|
||||
# f"|{round(last_candle['mid_smooth_24_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_1h_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv1_1d'],3) or '-' :>6}|"
|
||||
# f"{round(last_candle['mid_smooth_24_deriv2'],3) or '-' :>6}|{round(last_candle['mid_smooth_1h_deriv2'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv2_1d'],3) or '-':>6}|"
|
||||
# f"{round(val144, 1) or '-' :>6}|{round(val1h, 1) or '-':>6}|"
|
||||
@@ -649,7 +649,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
dataframe["percent5"] = (dataframe["close"] - dataframe["open"].shift(5)) / dataframe["open"].shift(5)
|
||||
dataframe["percent12"] = (dataframe["close"] - dataframe["open"].shift(12)) / dataframe["open"].shift(12)
|
||||
|
||||
dataframe = self.calculateDerivation(dataframe, window=12)
|
||||
dataframe = self.calculateDerivation(dataframe, window=3, suffixe="_3")
|
||||
dataframe["mid_re_smooth_3"] = self.conditional_smoothing(dataframe['mid_smooth_3'].dropna(), threshold=0.0005).dropna()
|
||||
self.calculeDerivees(dataframe, "mid_re_smooth_3")
|
||||
dataframe = self.calculateDerivation(dataframe, window=12, suffixe="_12")
|
||||
dataframe = self.calculateDerivation(dataframe, window=24, suffixe="_24", factor_1=1000, factor_2=10)
|
||||
|
||||
# print(metadata['pair'])
|
||||
@@ -835,9 +838,9 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
dataframe['up_pct'] = self.calculateUpDownPct(dataframe, 'up_count')
|
||||
|
||||
def calculateDerivation(self, dataframe, window=12, suffixe='', factor_1=100, factor_2=10):
|
||||
dataframe['mid'] = dataframe['open'] + (dataframe['close'] - dataframe['open']) / 2
|
||||
dataframe['mid'] = dataframe['haopen'] + (dataframe['haclose'] - dataframe['haopen']) / 2
|
||||
# 1. Calcul du lissage par moyenne mobile médiane
|
||||
dataframe[f"mid_smooth{suffixe}"] = dataframe['close'].rolling(window=window).mean()
|
||||
dataframe[f"mid_smooth{suffixe}"] = dataframe['haclose'].rolling(window=window).mean()
|
||||
# 2. Dérivée première = différence entre deux bougies successives
|
||||
dataframe[f"mid_smooth{suffixe}_deriv1"] = round(factor_1 * dataframe[f"mid_smooth{suffixe}"].rolling(window=3).mean().diff() / dataframe[f"mid_smooth{suffixe}"], 4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user