computeGrossProfitOrLoss method
Decimal
computeGrossProfitOrLoss(
- Decimal netBuyPrice,
- Decimal netSellPrice
Implementation
Decimal computeGrossProfitOrLoss(Decimal netBuyPrice, Decimal netSellPrice) {
late Decimal dDelta;
if (state.position! == MatexPosition.long) {
dDelta = netSellPrice - netBuyPrice;
} else {
dDelta = netBuyPrice - netSellPrice;
}
return dDelta;
}