artificially doule fees to promote more profitable trades

This commit is contained in:
Dobromir Popov
2025-07-17 19:22:35 +03:00
parent 6d55061e86
commit 26d440f772
3 changed files with 440 additions and 52 deletions

View File

@ -186,14 +186,24 @@ class DashboardComponentManager:
pnl_class = "text-success" if pnl >= 0 else "text-danger"
side_class = "text-success" if side == "BUY" else "text-danger"
# Calculate position size in USD
position_size_usd = size * entry_price
# Get leverage from trade or use default
leverage = trade.get('leverage', 1.0) if not hasattr(trade, 'entry_time') else getattr(trade, 'leverage', 1.0)
# Calculate leveraged PnL (already included in pnl value, but ensure it's displayed correctly)
# Ensure fees are subtracted from PnL for accurate profitability
net_pnl = pnl - fees
row = html.Tr([
html.Td(time_str, className="small"),
html.Td(side, className=f"small {side_class}"),
html.Td(f"{size:.3f}", className="small"),
html.Td(f"${position_size_usd:.2f}", className="small"), # Show size in USD
html.Td(f"${entry_price:.2f}", className="small"),
html.Td(f"${exit_price:.2f}", className="small"),
html.Td(f"{hold_time_seconds:.0f}", className="small text-info"),
html.Td(f"${pnl:.2f}", className=f"small {pnl_class}"),
html.Td(f"${net_pnl:.2f}", className=f"small {pnl_class}"), # Show net PnL after fees
html.Td(f"${fees:.3f}", className="small text-muted")
])
rows.append(row)