Zeus_11 optimise exit

This commit is contained in:
Jérôme Delacotte
2025-03-26 08:15:18 +01:00
parent a8031f63f2
commit b45627aadd

View File

@@ -1,3 +1,5 @@
# Zeus Strategy: First Generation of GodStra Strategy with maximum # Zeus Strategy: First Generation of GodStra Strategy with maximum
# AVG/MID profit in USDT # AVG/MID profit in USDT
# Author: @Mablue (Masoud Azizi) # Author: @Mablue (Masoud Azizi)
@@ -248,6 +250,9 @@ class Zeus_11(IStrategy):
dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe) dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
last_candle = dataframe.iloc[-1].squeeze() last_candle = dataframe.iloc[-1].squeeze()
before_last_candle = dataframe.iloc[-2].squeeze()
count_of_buys = trade.nr_of_successful_entries
# self.analyze_conditions(pair, dataframe) # self.analyze_conditions(pair, dataframe)
@@ -261,13 +266,15 @@ class Zeus_11(IStrategy):
# if current_rate >= atr_take_profit: # if current_rate >= atr_take_profit:
# return 'sell_atr_take_profit' # return 'sell_atr_take_profit'
if (last_candle['percent3'] < -0.002) & (last_candle['percent12'] < 0) & ( if (last_candle['percent3'] < 0.0) & (current_profit > last_candle['min_max200'] / 3):
current_profit > last_candle['min_max200'] / 3):
self.trades = list() self.trades = list()
return 'min_max200' return 'min_max200_' + str(count_of_buys)
if (last_candle['percent12'] <= -0.01) & (current_profit >= expected_profit): if (last_candle['percent12'] <= -0.01) & (current_profit >= expected_profit):
self.trades = list() self.trades = list()
return 'profit' return 'profit_' + str(count_of_buys)
if (last_candle['percent'] < 0.0) and ((last_candle['rsi'] >= 75) or before_last_candle['rsi'] >= 75):
self.trades = list()
return 'min_max200_' + str(count_of_buys)
def informative_pairs(self): def informative_pairs(self):
# get access to all pairs available in whitelist. # get access to all pairs available in whitelist.
@@ -559,9 +566,9 @@ class Zeus_11(IStrategy):
dataframe.loc[ dataframe.loc[
( (
#(dataframe['hapercent'] > 0) # (dataframe['hapercent'] > 0)
(dataframe['down_count'].shift(1) < - 6) (dataframe['down_count'].shift(1) < - 6)
& (dataframe['down_count'] == 0) & (dataframe['down_count'] == 0)
& (dataframe['down_pct'].shift(1) <= -0.5) & (dataframe['down_pct'].shift(1) <= -0.5)
), ['enter_long', 'enter_tag']] = (1, 'buy_hapercent') ), ['enter_long', 'enter_tag']] = (1, 'buy_hapercent')
dataframe['test'] = np.where(dataframe['enter_long'] == 1, dataframe['close'] * 1.01, np.nan) dataframe['test'] = np.where(dataframe['enter_long'] == 1, dataframe['close'] * 1.01, np.nan)
@@ -592,9 +599,9 @@ class Zeus_11(IStrategy):
if (len(dataframe) < 1): if (len(dataframe) < 1):
return None return None
pair = trade.pair pair = trade.pair
if pair not in ('BTC/USDC', 'DOGE/USDC', 'ETH/USDC'): # if pair not in ('BTC/USDC', 'DOGE/USDC', 'ETH/USDC'):
return None # return None
max_buys = 20 max_buys = 20
filled_buys = trade.select_filled_orders('buy') filled_buys = trade.select_filled_orders('buy')
count_of_buys = len(filled_buys) count_of_buys = len(filled_buys)
@@ -607,7 +614,7 @@ class Zeus_11(IStrategy):
# condition = False # condition = False
# self.protection_nb_buy_lost.value # self.protection_nb_buy_lost.value
limit = last_candle['limit'] limit = last_candle['limit']
stake_amount = min(200, self.adjust_stake_amount(pair, last_candle) * self.fibo[count_of_buys]) stake_amount = self.config['stake_amount'] + 50 * self.fibo[count_of_buys]
current_time_utc = current_time.astimezone(timezone.utc) current_time_utc = current_time.astimezone(timezone.utc)
open_date = trade.open_date.astimezone(timezone.utc) open_date = trade.open_date.astimezone(timezone.utc)