computeReturnOnInvestment method

Decimal computeReturnOnInvestment(
  1. Decimal netBuyPrice,
  2. Decimal dGrossPnl
)

Implementation

Decimal computeReturnOnInvestment(Decimal netBuyPrice, Decimal dGrossPnl) {
  final balance = netBuyPrice + dGrossPnl;

  return toDecimal(balance / netBuyPrice) - Decimal.one;
}