leveraged profits fix

This commit is contained in:
HojouFotytu 2021-02-09 13:28:37 +09:00
parent 24a1c97cdc
commit fb5d05f93c
1 changed files with 8 additions and 8 deletions

View File

@ -160,11 +160,6 @@
} }
} }
// Aggregate totals
double bagGain = (profitPercentage / 100) * dcaLogEntry.TotalCost * leverageValue;
Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost;
Model.TotalBagGain = Model.TotalBagGain + bagGain;
// Render the row // Render the row
<tr @(lostValue ? "class=errorRow" : "") > <tr @(lostValue ? "class=errorRow" : "") >
<!-- Market --> <!-- Market -->
@ -226,20 +221,25 @@
{ {
<td class="text-left"></td> <td class="text-left"></td>
} }
<!-- Profit --> <!-- Profit -->
@if (!@lostValue) @if (!@lostValue)
{ {
profitPercentage = profitPercentage * leverageValue;
<td class="text-autocolor">@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td> <td class="text-autocolor">@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td>
} }
else else
{ {
<td class="text-left">No Value!</td> <td class="text-left">No Value!</td>
} }
<!-- Bag details --> <!-- Bag details -->
<td class="text-right"><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)_get/BagDetails/?m=@dcaLogEntry.Market" data-remote="false" data-toggle="modal" data-target="#dca-chart"><i class="fa fa-plus-circle"></i></a></td> <td class="text-right"><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)_get/BagDetails/?m=@dcaLogEntry.Market" data-remote="false" data-toggle="modal" data-target="#dca-chart"><i class="fa fa-plus-circle"></i></a></td>
</tr> </tr>
{
// Aggregate totals
double bagGain = (profitPercentage / 100) * dcaLogEntry.TotalCost;
Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost;
Model.TotalBagGain = Model.TotalBagGain + bagGain;
}
} }
<td>Totals:</td> <td>Totals:</td>
<td></td> <td></td>