forked from kodorvan/stcs
Added the output of the current series number and the transaction
This commit is contained in:
@@ -118,6 +118,7 @@ class TelegramMessageHandler:
|
||||
|
||||
exec_pnl = format_value(execution.get("execPnl"))
|
||||
total_pnl = safe_float(exec_pnl) - safe_float(exec_fee) - fee
|
||||
|
||||
header = (
|
||||
"Сделка закрыта:" if safe_float(closed_size) > 0 else "Сделка открыта:"
|
||||
)
|
||||
@@ -129,11 +130,26 @@ class TelegramMessageHandler:
|
||||
user_deals_data = await rq.get_user_deal_by_symbol(
|
||||
tg_id=tg_id, symbol=symbol
|
||||
)
|
||||
if user_deals_data is not None and auto_trading:
|
||||
commission_fee = user_deals_data.commission_fee
|
||||
commission_place = user_deals_data.commission_place
|
||||
|
||||
if commission_fee == "Yes_commission_fee":
|
||||
if commission_place == "Commission_for_qty":
|
||||
total_quantity = safe_float(user_deals_data.order_quantity) + safe_float(
|
||||
total_fee
|
||||
)
|
||||
else:
|
||||
total_quantity = safe_float(user_deals_data.order_quantity)
|
||||
else:
|
||||
total_quantity = safe_float(user_deals_data.order_quantity)
|
||||
|
||||
if user_deals_data is not None and auto_trading and safe_float(closed_size) == 0:
|
||||
await rq.set_total_fee_user_auto_trading(
|
||||
tg_id=tg_id, symbol=symbol, total_fee=total_fee
|
||||
)
|
||||
text += f"Текущая ставка: {user_deals_data.order_quantity} USDT\n"
|
||||
text += f"Текущая ставка: {total_quantity:.2f} USDT\n"
|
||||
text += f"Серия №: {user_deals_data.current_series}\n"
|
||||
text += f"Сделка №: {user_deals_data.current_step}\n"
|
||||
|
||||
text += (
|
||||
f"Цена исполнения: {exec_price}\n"
|
||||
|
||||
Reference in New Issue
Block a user