Bot auto-update: src/main_ml.py
This commit is contained in:
parent
aacbeaf6df
commit
f34d0a49dd
|
|
@ -216,19 +216,19 @@ Reports: Alle 3h via Telegram 📊"""
|
||||||
# ROUND QUANTITY TO STEP SIZE
|
# ROUND QUANTITY TO STEP SIZE
|
||||||
qty_rounded = self._round_quantity(qty, pair)
|
qty_rounded = self._round_quantity(qty, pair)
|
||||||
|
|
||||||
# Place SL order
|
# Place SL order using correct Binance method
|
||||||
order = self.client.order_take_profit(
|
order = self.client.create_order(
|
||||||
symbol=pair,
|
symbol=pair,
|
||||||
side='SELL',
|
side='SELL',
|
||||||
type='STOP_LOSS',
|
type='STOP_LOSS_LIMIT',
|
||||||
timeInForce='GTC',
|
timeInForce='GTC',
|
||||||
quantity=qty_rounded,
|
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}%)")
|
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}")
|
logger.error(f"SL Error {pair}: {e}")
|
||||||
|
|
||||||
async def monitor_positions(self):
|
async def monitor_positions(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue