The logic of the trading cycle has been changed, fixed errors when setting TP and SL

This commit is contained in:
algizn97
2025-11-09 13:10:13 +05:00
parent 39bbe8d997
commit 7c85c03d10
4 changed files with 178 additions and 158 deletions

View File

@@ -39,13 +39,13 @@ async def stop_all_trading(callback_query: CallbackQuery, state: FSMContext):
await rq.set_stop_timer(tg_id=callback_query.from_user.id, timer_end=0)
await asyncio.sleep(timer_end * 60)
await close_position_by_symbol(
tg_id=callback_query.from_user.id, symbol=symbol)
await rq.set_auto_trading(
tg_id=callback_query.from_user.id,
symbol=symbol,
auto_trading=False,
)
await close_position_by_symbol(
tg_id=callback_query.from_user.id, symbol=symbol)
await callback_query.message.edit_text(text=f"Торговля для {symbol} остановлена", reply_markup=kbi.profile_bybit)