This commit is contained in:
Dobromir Popov
2025-08-08 02:12:01 +03:00
parent b80e1c1eba
commit 6214bc2e9f
2 changed files with 7 additions and 6 deletions

View File

@ -1452,8 +1452,8 @@ class TradingExecutor:
# Calculate position size in USD
position_size_usd = position.quantity * position.entry_price
# Calculate gross PnL (before fees) with leverage
gross_pnl = (current_price - position.entry_price) * position.quantity * leverage
# Calculate gross PnL (before fees) with leverage - SHORT profits when price falls
gross_pnl = (position.entry_price - current_price) * position.quantity * leverage
# Calculate net PnL (after fees)
net_pnl = gross_pnl - simulated_fees
@ -1543,8 +1543,8 @@ class TradingExecutor:
# Calculate position size in USD
position_size_usd = position.quantity * position.entry_price
# Calculate gross PnL (before fees) with leverage
gross_pnl = (current_price - position.entry_price) * position.quantity * leverage
# Calculate gross PnL (before fees) with leverage - SHORT profits when price falls
gross_pnl = (position.entry_price - current_price) * position.quantity * leverage
# Calculate net PnL (after fees)
net_pnl = gross_pnl - fees
@ -1630,7 +1630,7 @@ class TradingExecutor:
# Calculate position size in USD
position_size_usd = position.quantity * position.entry_price
# Calculate gross PnL (before fees) with leverage
# Calculate gross PnL (before fees) with leverage - LONG profits when price rises
gross_pnl = (current_price - position.entry_price) * position.quantity * leverage
# Calculate net PnL (after fees)