Calcul 20250101-20250714 1024.828 229 max 13 ETH 11 DOGE
This commit is contained in:
@@ -1097,16 +1097,15 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
pct_max = - pct
|
pct_max = - pct
|
||||||
|
|
||||||
if pair in ('BTC/USDT', 'BTC/USDC') or count_of_buys <= 2:
|
if pair in ('BTC/USDT', 'BTC/USDC') or count_of_buys <= 2:
|
||||||
lim = - pct - (count_of_buys * 0.003)
|
lim = - pct - (count_of_buys * 0.001)
|
||||||
#lim = self.getLimitBuy(pair, last_candle, pct)
|
#lim = self.getLimitBuy(pair, last_candle, pct)
|
||||||
# lim = - (0.012 * (1 + round(count_of_buys / 5)) + 0.001 * (count_of_buys - 1))
|
# lim = - (0.012 * (1 + round(count_of_buys / 5)) + 0.001 * (count_of_buys - 1))
|
||||||
# lim = - (0.012 + 0.001 * (count_of_buys - 1) + (0.002 * count_of_buys if count_of_buys > 10 else 0.001 * count_of_buys if count_of_buys > 5 else 0))
|
# lim = - (0.012 + 0.001 * (count_of_buys - 1) + (0.002 * count_of_buys if count_of_buys > 10 else 0.001 * count_of_buys if count_of_buys > 5 else 0))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# lim = self.calculatePctSliding(pair, last_candle)
|
pct = 0.05
|
||||||
pct = 0.025
|
lim = - pct - (count_of_buys * 0.001)
|
||||||
# lim = - pct - (count_of_buys * 0.001)
|
#lim = self.getLimitBuy(pair, last_candle, pct)
|
||||||
lim = self.getLimitBuy(pair, last_candle, pct)
|
|
||||||
|
|
||||||
if (len(dataframe) < 1):
|
if (len(dataframe) < 1):
|
||||||
print("skip dataframe")
|
print("skip dataframe")
|
||||||
@@ -1384,15 +1383,25 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# Calculer le minimum des 14 derniers jours
|
# Calculer le minimum des 14 derniers jours
|
||||||
base_stake_amount = self.config.get('stake_amount') # Montant de base configuré
|
base_stake_amount = self.config.get('stake_amount') # Montant de base configuré
|
||||||
|
|
||||||
# last_candle['max60_1d'] - last_candle['min60_1d']
|
if not pair in ('BTC/USDT', 'BTC/USDC'):
|
||||||
last_max = self.pairs[pair]['last_max']
|
# factors = [1, 1.2, 1.3, 1.4]
|
||||||
last_min = self.pairs[pair]['last_min']
|
adjusted_stake_amount = base_stake_amount
|
||||||
|
else :
|
||||||
|
first_price = self.pairs[pair]['first_buy']
|
||||||
|
if (first_price == 0):
|
||||||
|
first_price = last_candle['close']
|
||||||
|
|
||||||
ecart = 1
|
last_max = last_candle['max12_1d']
|
||||||
if (last_max > 0 and last_min > 0):
|
pct = 5
|
||||||
ecart = 1 + (last_max - last_min) / last_max
|
if last_max > 0:
|
||||||
|
pct = 100 * (last_max - first_price) / last_max
|
||||||
|
|
||||||
adjusted_stake_amount = base_stake_amount * ecart
|
factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
|
||||||
|
adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
|
||||||
|
|
||||||
|
# pct = 100 * abs(self.getPctFirstBuy(pair, last_candle))
|
||||||
|
#
|
||||||
|
# factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
|
||||||
|
|
||||||
return adjusted_stake_amount
|
return adjusted_stake_amount
|
||||||
|
|
||||||
@@ -1440,12 +1449,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
return out_max - position * (out_max - out_min)
|
return out_max - position * (out_max - out_min)
|
||||||
|
|
||||||
def expectedProfit(self, pair: str, last_candle: DataFrame):
|
def expectedProfit(self, pair: str, last_candle: DataFrame):
|
||||||
pct_to_max = 0.004
|
|
||||||
max_60 = last_candle['max60_1d']
|
|
||||||
if last_candle['close'] < max_60:
|
|
||||||
pct_to_max = 0.25 * (max_60 - last_candle['close']) / max_60
|
|
||||||
|
|
||||||
expected_profit = pct_to_max # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
count_of_buys = self.pairs[pair]['count_of_buys']
|
||||||
|
pct_first = self.getPctFirstBuy(pair, last_candle)
|
||||||
|
|
||||||
|
expected_profit = max(0.004, abs(pct_first / 3)) # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
||||||
|
|
||||||
# print(
|
# print(
|
||||||
# f"Expected profit price={current_price:.4f} min_max={min_max:.4f} min_14={min_14_days:.4f} max_14={max_14_days:.4f} percent={percent:.4f} expected_profit={expected_profit:.4f}")
|
# f"Expected profit price={current_price:.4f} min_max={min_max:.4f} min_14={min_14_days:.4f} max_14={max_14_days:.4f} percent={percent:.4f} expected_profit={expected_profit:.4f}")
|
||||||
@@ -1963,7 +1971,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
|
|
||||||
limit = 3
|
limit = 3
|
||||||
|
|
||||||
if pair.startswith('BTC') or self.pairs[pair]['count_of_buys'] == 0:
|
if pair.startswith('BTC'):
|
||||||
return True # BTC toujours autorisé
|
return True # BTC toujours autorisé
|
||||||
|
|
||||||
# Filtrer les paires non-BTC
|
# Filtrer les paires non-BTC
|
||||||
@@ -1979,7 +1987,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
max_pair = p
|
max_pair = p
|
||||||
total_non_btc += self.pairs[p]['count_of_buys']
|
total_non_btc += self.pairs[p]['count_of_buys']
|
||||||
|
|
||||||
pct_max = self.getPctLastBuy(pair, last_candle)
|
pct_max = self.getPctFirstBuy(pair, last_candle) #self.getPctLastBuy(pair, last_candle)
|
||||||
|
|
||||||
# val = self.getProbaHausse(last_candle)
|
# val = self.getProbaHausse(last_candle)
|
||||||
# if (val < 40):
|
# if (val < 40):
|
||||||
@@ -1993,21 +2001,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
|
|
||||||
self.should_enter_trade_count = 0
|
self.should_enter_trade_count = 0
|
||||||
|
|
||||||
# if last_candle['mid_smooth_1h_deriv1'] < -0.15 and last_candle['mid_smooth_1h_deriv2'] <= -0.15:
|
|
||||||
# return False
|
|
||||||
#
|
|
||||||
# if last_candle['sma20_deriv1_1d'] < -0.08 and last_candle['sma5_deriv1_1d'] <= -0.1:
|
|
||||||
# return False
|
|
||||||
#
|
|
||||||
# if (self.pairs[pair]['count_of_buys'] >= 5):
|
|
||||||
# val = self.getProbaHausseSma5d(last_candle)
|
|
||||||
# if (val < 30):
|
|
||||||
# return False
|
|
||||||
|
|
||||||
if last_candle['sma5_deriv1_1d'] < -0.1:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if max_pair != '' :
|
if max_pair != '' :
|
||||||
return max_pair == pair
|
return max_pair == pair or pct_max < - 0.25
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user