fix: показывать комиссию в долларах (конвертация из BTC)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-09 06:27:19 +10:00
co-authored by Claude Opus 4.6
parent 14daf4cf9b
commit 8a68ad458c
+14 -2
View File
@@ -242,7 +242,13 @@ def _check_position(conn, pos, prices, dates, asset, asset_cfg, cfg):
fee = order.get("fee") or {}
fee_cost = fee.get("cost")
fee_cur = fee.get("currency", "")
fee_str = f" fee={fee_cost} {fee_cur}" if fee_cost else ""
if fee_cost and fee_cur != "USDC":
fee_usd = float(fee_cost) * exit_price
fee_str = f" fee=${fee_usd:.2f}"
elif fee_cost:
fee_str = f" fee=${float(fee_cost):.2f}"
else:
fee_str = ""
msg += f" [LIVE SELL OK{fee_str}]"
else:
msg += " [LIVE SELL FAILED]"
@@ -366,7 +372,13 @@ def _check_signal(conn, ticker, prices, dates, asset, asset_cfg, cfg):
fee = order.get("fee") or {}
fee_cost = fee.get("cost")
fee_cur = fee.get("currency", "")
fee_str = f" fee={fee_cost} {fee_cur}" if fee_cost else ""
if fee_cost and fee_cur != "USDC":
fee_usd = float(fee_cost) * entry_price
fee_str = f" fee=${fee_usd:.2f}"
elif fee_cost:
fee_str = f" fee=${float(fee_cost):.2f}"
else:
fee_str = ""
msg += f" [LIVE BUY OK{fee_str}]"
else:
# Rollback paper position — no phantom positions