toJson method

  1. @override
Map<String, dynamic> toJson()
override

Returns a JSON representation of this object.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'accountCode': accountCode,
    'baseCode': baseCode,
    'counterCode': counterCode,
    'customPrice': customPrice,
    'highPrice': highPrice,
    'lowPrice': lowPrice,
    'precision': precision,
    'trend': trend?.index,
    'extensionLevels': extensionLevels,
    'retracementLevels': retracementLevels,
    'counterAccountCurrencyPairExchangeRate':
        counterAccountCurrencyPairExchangeRate,
    'tradingPairExchangeRate': tradingPairExchangeRate,
    'positionSize': positionSize,
    'pipPrecision': pipPrecision,
    'lotDescriptors': lotDescriptors?.toJson(),
    'baseListedSecond': baseListedSecond,
    'leverage': leverage,
    'closePrice': closePrice,
    'openPrice': openPrice,
    'method': method?.index,
    'accountSize': accountSize,
    'amountAtRisk': amountAtRisk,
    'riskRatio': riskRatio,
    'entryPrice': entryPrice,
    'position': position?.index,
    'stopLossPips': stopLossPips,
    'stopLossPrice': stopLossPrice,
    'stopLossAmount': stopLossAmount,
    'takeProfitPips': takeProfitPips,
    'takeProfitPrice': takeProfitPrice,
    'takeProfitAmount': takeProfitAmount,
    'exchangeRateLastUpdateAt': exchangeRateLastUpdateAt,
    'exitPrice': exitPrice,
    'entryFeePercentage': entryFeePercentage,
    'entryFeeAmount': entryFeeAmount,
    'exitFeePrecentage': exitFeePercentage,
    'exitFeeAmount': exitFeeAmount,
    'taxRate': taxRate,
    'priceA': priceA,
    'priceB': priceB,
    'fixedCosts': fixedCosts,
    'exitDiscountAmount': exitDiscountAmount,
    'exitDiscountPercentage': exitDiscountPercentage,
    'entryFeePercentagePerUnit': entryFeePercentagePerUnit,
    'entryFeeAmountPerUnit': entryFeeAmountPerUnit,
    'exitFeePercentagePerUnit': exitFeePercentagePerUnit,
    'exitFeeAmountPerUnit': exitFeeAmountPerUnit,
    'dividendPaymentFrequency': dividendPaymentFrequency?.index,
    'annualSharePriceIncrease': annualSharePriceIncrease,
    'annualDividendIncrease': annualDividendIncrease,
    'annualContribution': annualContribution,
    'numberOfShares': numberOfShares,
    'dividendYield': dividendYield,
    'yearsToGrow': yearsToGrow,
    'sharePrice': sharePrice,
    'drip': drip,
    'taxExemptAmountPerYear': taxExemptAmountPerYear,
    'totalDividend': totalDividend,
    'netIncome': netIncome,
  };
}