diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index 9793351..48ae690 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -159,11 +159,6 @@ profitPercentage = gainStrategy.CurrentValue; } } - - // Aggregate totals - double bagGain = (profitPercentage / 100) * dcaLogEntry.TotalCost * leverageValue; - Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost; - Model.TotalBagGain = Model.TotalBagGain + bagGain; // Render the row @@ -226,20 +221,25 @@ { } - @if (!@lostValue) - { + { + profitPercentage = profitPercentage * leverageValue; @profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% } else { No Value! } - + { + // Aggregate totals + double bagGain = (profitPercentage / 100) * dcaLogEntry.TotalCost; + Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost; + Model.TotalBagGain = Model.TotalBagGain + bagGain; + } } Totals: