diff --git a/directionalscalper/core/strategies/bybit/bybit_strategy.py b/directionalscalper/core/strategies/bybit/bybit_strategy.py index 5d5bafbf..3df9b063 100644 --- a/directionalscalper/core/strategies/bybit/bybit_strategy.py +++ b/directionalscalper/core/strategies/bybit/bybit_strategy.py @@ -44,9 +44,9 @@ def __init__(self, exchange, config, manager, symbols_allowed=None): self.filled_order_levels = {} self.filled_levels = {} self.active_grids = set() - self.position_inactive_threshold = 120 - self.no_entry_signal_threshold = 120 - self.order_inactive_threshold = 120 + self.position_inactive_threshold = 300 + self.no_entry_signal_threshold = 300 + self.order_inactive_threshold = 300 pass TAKER_FEE_RATE = 0.00055 diff --git a/multi_bot.py b/multi_bot.py index 7aae4617..9c575474 100644 --- a/multi_bot.py +++ b/multi_bot.py @@ -413,7 +413,12 @@ def update_active_threads(open_position_symbols, args, manager, symbols_allowed) def manage_rotator_symbols(rotator_symbols, args, manager, symbols_allowed): global active_symbols needed_slots = symbols_allowed - len(active_symbols) - for symbol in rotator_symbols: + + # Convert set to list and shuffle for random selection + random_rotator_symbols = list(rotator_symbols) + random.shuffle(random_rotator_symbols) + + for symbol in random_rotator_symbols: if needed_slots <= 0: break if symbol not in active_symbols and (symbol not in threads or not threads[symbol][0].is_alive()): @@ -422,7 +427,7 @@ def manage_rotator_symbols(rotator_symbols, args, manager, symbols_allowed): needed_slots -= 1 logging.info(f"Added new thread for rotator symbol: {symbol}") manage_excess_threads(symbols_allowed) - + def manage_excess_threads(symbols_allowed): global active_symbols while len(active_symbols) > symbols_allowed: