fix: показывать TF и плечо у каждой позиции в Telegram
Было: "ETH-USD: 🟢 LONG" Стало: "ETH-USD (2h 2x): 🟢 LONG" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,13 @@ def format_status_report(cfg, conn) -> str:
|
||||
lines.append(f"\U0001f4c8 <b>Позиции</b> ({len(open_positions)}/{cfg.risk.max_open_positions})")
|
||||
for a, pos, cur_price in open_positions:
|
||||
d = "\U0001f7e2 LONG" if pos["direction"] == 1 else "\U0001f534 SHORT"
|
||||
# Find per-asset timeframe
|
||||
_tf = cfg.timeframe
|
||||
for ac in cfg.assets:
|
||||
if ac.ticker == a["ticker"]:
|
||||
_tf = ac.timeframe or cfg.timeframe
|
||||
break
|
||||
lev_str = f" {cfg.risk.leverage}x" if cfg.risk.leverage > 1 else ""
|
||||
entry = pos["entry_price"]
|
||||
stop = pos["stop_price"]
|
||||
size = pos["pos_value"]
|
||||
@@ -144,7 +151,7 @@ def format_status_report(cfg, conn) -> str:
|
||||
else:
|
||||
pnl_str = ""
|
||||
|
||||
lines.append(f" {a['ticker']}: {d}")
|
||||
lines.append(f" {a['ticker']} ({_tf}{lev_str}): {d}")
|
||||
lines.append(f" Вход: ${entry:,.2f} | Стоп: ${stop:,.2f} ({risk_pct:.1f}%)")
|
||||
lines.append(f" Размер: ${size:,.2f}{pnl_str}")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user