Skip to content

Commit

Permalink
Auto GS
Browse files Browse the repository at this point in the history
  • Loading branch information
donewiththedollar committed Jul 19, 2024
1 parent 5d6367f commit 566180a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions directionalscalper/core/strategies/bybit/bybit_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5533,7 +5533,7 @@ def handle_auto_reduce(self, symbol, grid_levels_long, grid_levels_short, long_g
logging.info(f"Symbols allowed: {symbols_allowed}")

if additional_entries_from_signal:
if (length_of_open_symbols_long <= symbols_allowed or length_of_open_symbols_short <= symbols_allowed) or symbol in open_symbols:
if (length_of_open_symbols_long <= symbols_allowed or length_of_open_symbols_short <= symbols_allowed) and symbol in open_symbols:
logging.info(f"Allowed symbol: {symbol}")

fresh_signal = self.generate_l_signals(symbol)
Expand Down Expand Up @@ -5570,7 +5570,7 @@ def handle_auto_reduce(self, symbol, grid_levels_long, grid_levels_short, long_g
logging.info(f"[{symbol}] MFIRSI signal unchanged: {fresh_signal}")

# Proceed with the signal handling regardless of whether it's a retry or a new signal
if fresh_signal.lower() == "long" and long_mode and not self.auto_reduce_active_long.get(symbol, False) and not graceful_stop_long:
if fresh_signal.lower() == "long" and long_mode and not self.auto_reduce_active_long.get(symbol, False):
if symbol not in self.max_qty_reached_symbol_long:
if long_pos_qty > 0.00001: # Check if a long position already exists
if current_price <= long_pos_price: # Enter additional entry only if current price <= long_pos_price
Expand Down Expand Up @@ -5618,7 +5618,7 @@ def handle_auto_reduce(self, symbol, grid_levels_long, grid_levels_short, long_g
self.last_signal_time[symbol] = current_time
self.last_mfirsi_signal[symbol] = "neutral" # Reset to neutral after processing

elif fresh_signal.lower() == "short" and short_mode and not self.auto_reduce_active_short.get(symbol, False) and not graceful_stop_short:
elif fresh_signal.lower() == "short" and short_mode and not self.auto_reduce_active_short.get(symbol, False):
if symbol not in self.max_qty_reached_symbol_short:
if short_pos_qty > 0.00001: # Check if a short position already exists
if current_price >= short_pos_price: # Enter additional entry only if current price >= short_pos_price
Expand Down

0 comments on commit 566180a

Please sign in to comment.