Fixed the function of setting TP and SL

This commit is contained in:
algizn97
2025-11-02 17:14:22 +05:00
parent dbf0a30d54
commit e0167ea406
2 changed files with 10 additions and 9 deletions

View File

@@ -54,12 +54,6 @@ async def start_trading_cycle(
tg_id=tg_id,
symbol=symbol,
mode=0)
await set_margin_mode(tg_id=tg_id, margin_mode=margin_type)
await set_leverage(
tg_id=tg_id,
symbol=symbol,
leverage=leverage,
)
await rq.set_user_deal(
tg_id=tg_id,
@@ -316,7 +310,12 @@ async def open_positions(
try:
client = await get_bybit_client(tg_id=tg_id)
get_ticker = await get_tickers(tg_id, symbol=symbol)
price_symbol = safe_float(get_ticker.get("lastPrice")) or 0
if get_ticker is None:
price_symbol = 0
else:
price_symbol = safe_float(get_ticker.get("lastPrice"))
instruments_info = await get_instruments_info(tg_id=tg_id, symbol=symbol)
qty_step_str = instruments_info.get("lotSizeFilter").get("qtyStep")
qty_step = safe_float(qty_step_str)