修复盈亏面板的f-string格式错误
This commit is contained in:
parent
7c4a44d404
commit
d6f866b769
@ -240,6 +240,9 @@ class StaticGrid(IStrategy):
|
||||
unrealized = (grid_manager.current_price - grid_manager.avg_entry_price) * grid_manager.total_quantity if grid_manager.total_quantity > 0 else 0
|
||||
unrealized_pct = (grid_manager.current_price - grid_manager.avg_entry_price) / grid_manager.avg_entry_price * 100 if grid_manager.avg_entry_price > 0 else 0
|
||||
|
||||
lowest_price_str = f"{grid_manager.lowest_price:.4f}" if grid_manager.lowest_price != float('inf') else 'N/A'
|
||||
status_str = '亏损💥' if unrealized < 0 else '盈利✅'
|
||||
|
||||
# 一旧扯住盈亏面板
|
||||
panel = f"""
|
||||
┌{'='*100}┐
|
||||
@ -251,8 +254,8 @@ class StaticGrid(IStrategy):
|
||||
│ │
|
||||
│ 【盈亏情况】 │
|
||||
│ • 未实珰: {unrealized:+.2f} USDT ({unrealized_pct:+.2f}%) │
|
||||
│ • 最高价: {grid_manager.highest_price:.4f} USDT | 最低价: {grid_manager.lowest_price:.4f if grid_manager.lowest_price != float('inf') else 'N/A'}│
|
||||
│ • 状态: {'亏损💥' if unrealized < 0 else '盈利✅'} │
|
||||
│ • 最高价: {grid_manager.highest_price:.4f} USDT | 最低价: {lowest_price_str}│
|
||||
│ • 状态: {status_str} │
|
||||
│ │
|
||||
│ 【捷站显示】 │
|
||||
│ • gridMgr_id: {grid_manager.hash_id} | 创建时间: {grid_manager.created_time} │
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user