43 var closedPosition =
false;
56 var feeInAccountCurrency = 0m;
94 var quantityClosed = Math.Sign(-fill.
FillQuantity) * absoluteQuantityClosed;
98 var lastTradeProfit = closedSaleValueInQuoteCurrency.
Amount - closedCost.Amount;
99 var lastTradeProfitInAccountCurrency = closedSaleValueInQuoteCurrency.InAccountCurrency - closedCost.InAccountCurrency;
110 var transactionProfitLoss = lastTradeProfitInAccountCurrency - 2 * feeInAccountCurrency;
113 transactionProfitLoss,
114 fill.IsWin(security, transactionProfitLoss));
119 if (quantityHoldings == 0)
139 if (quantityHoldings < 0)
144 else if (quantityHoldings == 0)
146 averageHoldingsPrice = 0;
159 if (quantityHoldings > 0)
164 else if (quantityHoldings == 0)
166 averageHoldingsPrice = 0;
180 catch (Exception err)
186 security.Holdings.SetHoldings(averageHoldingsPrice, quantityHoldings);