adjusted percentages of TP and SL
This commit is contained in:
		@@ -39,21 +39,15 @@ 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)
 | 
			
		||||
 | 
			
		||||
            user_auto_trading = await rq.get_user_auto_trading(
 | 
			
		||||
                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)
 | 
			
		||||
 | 
			
		||||
            if user_auto_trading and user_auto_trading.auto_trading:
 | 
			
		||||
                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)
 | 
			
		||||
            else:
 | 
			
		||||
                await callback_query.message.edit_text(text=f"Нет активной торговли для {symbol}", reply_markup=kbi.profile_bybit)
 | 
			
		||||
 | 
			
		||||
        task = asyncio.create_task(delay_start())
 | 
			
		||||
        await add_stop_task(user_id=callback_query.from_user.id, task=task)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user