Refactor BacktestExecutor to use net PnL calculations consistently across methods. Updated variable names for clarity and ensured final results reflect net profit after fees. Minor adjustment in TradingBotBase to directly access net PnL from position profit and loss.
This commit is contained in:
@@ -2132,7 +2132,7 @@ public class TradingBotBase : ITradingBot
|
||||
{
|
||||
if (position.IsValidForMetrics() && position.ProfitAndLoss != null)
|
||||
{
|
||||
netPnl += position.GetPnLBeforeFees();
|
||||
netPnl += position.ProfitAndLoss.Net;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user