diff --git a/src/main_ml.py b/src/main_ml.py index 19f5e94..5840077 100644 --- a/src/main_ml.py +++ b/src/main_ml.py @@ -216,19 +216,19 @@ Reports: Alle 3h via Telegram 📊""" # ROUND QUANTITY TO STEP SIZE qty_rounded = self._round_quantity(qty, pair) - # Place SL order - order = self.client.order_take_profit( + # Place SL order using correct Binance method + order = self.client.create_order( symbol=pair, side='SELL', - type='STOP_LOSS', + type='STOP_LOSS_LIMIT', timeInForce='GTC', quantity=qty_rounded, - stopPrice=sl_price, - price=sl_price + price=sl_price, + stopPrice=sl_price ) logger.info(f"🛡️ SL: {pair} x{qty_rounded:.8f} @ ${sl_price:.4f} (-{self.STOP_LOSS_PERCENT}%)") - except BinanceAPIException as e: + except Exception as e: logger.error(f"SL Error {pair}: {e}") async def monitor_positions(self):