Fix profit calculation
This commit is contained in:
parent
6d2050310c
commit
48b3d7c521
|
@ -304,9 +304,8 @@ namespace Core.Main.DataObjects
|
|||
sellLogData.AverageBuyPrice = rsld.avgPrice;
|
||||
sellLogData.TotalCost = sellLogData.SoldAmount * sellLogData.AverageBuyPrice;
|
||||
|
||||
|
||||
|
||||
if (sellLogData.ProfitPercent >0)
|
||||
// check if sale was a short position
|
||||
if ((sellLogData.ProfitPercent > 0) && (sellLogData.AverageBuyPrice > sellLogData.SoldPrice))
|
||||
{
|
||||
double soldValueRaw = (sellLogData.SoldAmount * sellLogData.SoldPrice);
|
||||
double soldValueAfterFees = soldValueRaw + (soldValueRaw * ((double)rsld.fee / 100));
|
||||
|
|
Loading…
Reference in New Issue