Fixed take profit calculation. Added a position check for the current pair when trying to change the margin.
This commit is contained in:
@@ -47,7 +47,7 @@ async def start_trading(callback_query: CallbackQuery, state: FSMContext) -> Non
|
||||
|
||||
if safe_float(size) > 0:
|
||||
await callback_query.answer(
|
||||
text="У вас есть активная позиция",
|
||||
text="У вас есть активная позиция по текущей паре",
|
||||
)
|
||||
return
|
||||
|
||||
@@ -56,7 +56,7 @@ async def start_trading(callback_query: CallbackQuery, state: FSMContext) -> Non
|
||||
|
||||
if orders is not None:
|
||||
await callback_query.answer(
|
||||
text="У вас есть активные ордера",
|
||||
text="У вас есть активный ордер по текущей паре",
|
||||
)
|
||||
return
|
||||
|
||||
@@ -94,13 +94,14 @@ async def start_trading(callback_query: CallbackQuery, state: FSMContext) -> Non
|
||||
)
|
||||
|
||||
error_messages = {
|
||||
"Limit price is out min price": "Цена лимитного ордера меньше минимального",
|
||||
"Limit price is out max price": "Цена лимитного ордера больше максимального",
|
||||
"Limit price is out min price": "Цена лимитного ордера меньше допустимого",
|
||||
"Limit price is out max price": "Цена лимитного ордера больше допустимого",
|
||||
"Risk is too high for this trade": "Риск сделки превышает допустимый убыток",
|
||||
"estimated will trigger liq": "Лимитный ордер может вызвать мгновенную ликвидацию. Проверьте параметры ордера.",
|
||||
"ab not enough for new order": "Недостаточно средств для создания нового ордера",
|
||||
"InvalidRequestError": "Произошла ошибка при запуске торговли.",
|
||||
"Order does not meet minimum order value": "Сумма ставки меньше допустимого для запуска торговли.",
|
||||
"Order does not meet minimum order value": "Сумма ставки меньше допустимого для запуска торговли. "
|
||||
"Увеличьте ставку, чтобы запустить торговлю",
|
||||
"position idx not match position mode": "Измените режим позиции, чтобы запустить торговлю",
|
||||
"Qty invalid": "Некорректное значение ставки для данного инструмента",
|
||||
"The number of contracts exceeds maximum limit allowed": "️️Превышен максимальный лимит ставки",
|
||||
|
Reference in New Issue
Block a user