Separate gross vs net backtest profit display

This commit is contained in:
chrisnov-it
2026-05-19 19:41:49 +08:00
parent 01504ac9e3
commit 0c239418a6
2 changed files with 11 additions and 4 deletions
+3 -3
View File
@@ -111,9 +111,9 @@ document.addEventListener('DOMContentLoaded', () => {
resultsContainer.classList.remove('hidden');
// Enhanced display with spread costs and protection info
const spreadCosts = data.total_spread_costs || 0;
const netProfit = data.net_profit_after_costs || data.total_profit_usd;
const grossProfit = data.total_profit_usd || 0;
const spreadCosts = data.total_spread_costs ?? 0;
const netProfit = data.net_profit_after_costs ?? data.total_profit_usd ?? 0;
const grossProfit = data.gross_profit_usd ?? (netProfit + spreadCosts);
const instrument = data.instrument || 'UNKNOWN';
// Check if protection was applied