Calcul 20240101-20250514 2984.403 220.573$ => 13,21 max 11 mises BTC / 14 mises DOGE
This commit is contained in:
@@ -657,8 +657,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
|
||||
self.calculeDerivees(informative, 'sma5', factor_1=10, factor_2=1)
|
||||
|
||||
informative['futur_percent_3'] = 100 * (
|
||||
(informative['sma5'].shift(-3) - informative['sma5']) / informative['sma5'])
|
||||
# informative['futur_percent_3'] = 100 * ((informative['sma5'].shift(-3) - informative['sma5']) / informative['sma5'])
|
||||
|
||||
# if self.dp.runmode.value in ('backtest'):
|
||||
# print("##################")
|
||||
@@ -767,8 +766,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
#
|
||||
# horizon_h = 24 * 5
|
||||
# dataframe['futur_percent_1h'] = 100 * ((dataframe['mid_smooth_1h'].shift(-12) - dataframe['mid_smooth_1h']) / dataframe['mid_smooth_1h']).rolling(horizon_h).mean()
|
||||
dataframe['futur_percent_3h'] = 100 * (
|
||||
(dataframe['close'].shift(-36) - dataframe['close']) / dataframe['close']).rolling(horizon_h).mean()
|
||||
# dataframe['futur_percent_3h'] = 100 * ((dataframe['close'].shift(-36) - dataframe['close']) / dataframe['close']).rolling(horizon_h).mean()
|
||||
# dataframe['futur_percent_5h'] = 100 * ((dataframe['mid_smooth_1h'].shift(-60) - dataframe['mid_smooth_1h']) / dataframe['mid_smooth_1h']).rolling(horizon_h).mean()
|
||||
# dataframe['futur_percent_12h'] = 100 * ((dataframe['mid_smooth_1h'].shift(-144) - dataframe['mid_smooth_1h']) / dataframe['mid_smooth_1h']).rolling(horizon_h).mean()
|
||||
#
|
||||
@@ -781,12 +779,12 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
abs(dataframe['volume'].shift(1)) + abs(dataframe['volume'].shift(2)))
|
||||
|
||||
self.calculeDerivees(dataframe, 'ema_volume', factor_1=10, factor_2=1)
|
||||
if self.dp.runmode.value in ('backtest'):
|
||||
print("##################")
|
||||
print("# STAT DAY vs HOUR")
|
||||
print("##################")
|
||||
self.calculateProbabilite2Index(dataframe, futur_cols=['futur_percent_3h'], indic_1='ema_volume',
|
||||
indic_2='mid_smooth_1h_deriv1')
|
||||
# if self.dp.runmode.value in ('backtest'):
|
||||
# print("##################")
|
||||
# print("# STAT DAY vs HOUR")
|
||||
# print("##################")
|
||||
# self.calculateProbabilite2Index(dataframe, futur_cols=['futur_percent_3h'], indic_1='ema_volume',
|
||||
# indic_2='mid_smooth_1h_deriv1')
|
||||
|
||||
dataframe['proba_hausse'] = dataframe.apply(lambda row: self.getProbaHausse(row), axis=1)
|
||||
|
||||
@@ -1253,22 +1251,22 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
factors = [1, 1.25, 1.5, 2.0]
|
||||
|
||||
if not pair in ('BTC/USDT', 'BTC/USDC'):
|
||||
factors = [1, 1.2, 1.3, 1.4]
|
||||
base_stake_amount = base_stake_amount * 0.75
|
||||
# factors = [1, 1.2, 1.3, 1.4]
|
||||
adjusted_stake_amount = base_stake_amount
|
||||
else :
|
||||
first_price = self.pairs[pair]['first_buy']
|
||||
if (first_price == 0):
|
||||
first_price = last_candle['close']
|
||||
|
||||
first_price = self.pairs[pair]['first_buy']
|
||||
if (first_price == 0):
|
||||
first_price = last_candle['close']
|
||||
last_max = last_candle['max12_1d']
|
||||
pct = 5
|
||||
if last_max > 0:
|
||||
pct = 100 * (last_max - first_price) / last_max
|
||||
thresholds = [2, 5, 10, 20]
|
||||
|
||||
last_max = last_candle['max12_1d']
|
||||
pct = 5
|
||||
if last_max > 0:
|
||||
pct = 100 * (last_max - first_price) / last_max
|
||||
thresholds = [2, 5, 10, 20]
|
||||
factor = self.multi_step_interpolate(pct, thresholds, factors)
|
||||
|
||||
factor = self.multi_step_interpolate(pct, thresholds, factors)
|
||||
|
||||
adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
|
||||
adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
|
||||
|
||||
return adjusted_stake_amount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user