Leverage calculations issues fixed for distibution chart

This commit is contained in:
djbadders 2021-02-17 15:35:23 +00:00
parent 4fdd0ed112
commit d7f61da1b6
1 changed files with 3 additions and 3 deletions

View File

@ -196,15 +196,15 @@ namespace Monitor.Pages
{ {
if (sellStrategyText.Contains("PENDING")) if (sellStrategyText.Contains("PENDING"))
{ {
PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1);
} }
else if (dcaLogEntry.BuyStrategies.Count > 0) else if (dcaLogEntry.BuyStrategies.Count > 0)
{ {
DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1);
} }
else else
{ {
PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1);
} }
} }
} }