copyWith method

  1. @override
MatexBaseCoreState copyWith({
  1. double? customPrice,
  2. double? highPrice,
  3. double? lowPrice,
  4. int? precision,
  5. MatexTrend? trend,
  6. List<double>? extensionLevels,
  7. List<double>? retracementLevels,
  8. double? counterAccountCurrencyPairExchangeRate,
  9. double? tradingPairExchangeRate,
  10. double? positionSize,
  11. int? pipPrecision,
  12. MatexLotDescriptors? lotDescriptors,
  13. bool? baseListedSecond,
  14. double? leverage,
  15. double? closePrice,
  16. double? openPrice,
  17. MatexPivotPointsMethods? method,
  18. double? accountSize,
  19. double? entryPrice,
  20. double? amountAtRisk,
  21. double? riskRatio,
  22. MatexPosition? position,
  23. double? stopLossPips,
  24. double? stopLossPrice,
  25. double? stopLossAmount,
  26. double? takeProfitPips,
  27. double? takeProfitPrice,
  28. double? takeProfitAmount,
  29. String? accountCode,
  30. String? baseCode,
  31. String? counterCode,
  32. int? exchangeRateLastUpdateAt,
  33. double? exitPrice,
  34. double? entryFeePercentage,
  35. double? entryFeeAmount,
  36. double? exitFeePrecentage,
  37. double? exitFeeAmount,
  38. double? taxRate,
  39. double? priceA,
  40. double? priceB,
  41. double? exitFeePercentage,
  42. double? fixedCosts,
  43. double? exitDiscountAmount,
  44. double? exitDiscountPercentage,
  45. double? entryFeePercentagePerUnit,
  46. double? entryFeeAmountPerUnit,
  47. double? exitFeePercentagePerUnit,
  48. double? exitFeeAmountPerUnit,
  49. bool? drip,
  50. MatexFrequency? dividendPaymentFrequency,
  51. double? annualSharePriceIncrease,
  52. double? annualDividendIncrease,
  53. double? annualContribution,
  54. double? numberOfShares,
  55. double? dividendYield,
  56. int? yearsToGrow,
  57. double? sharePrice,
  58. double? taxExemptAmountPerYear,
  59. double? totalDividend,
  60. double? netIncome,
})
override

Creates a copy of this TModel but with the given fields replaced with the new values.

For example:

var myModel2 = myModel1.copyWith(age: 42);

Implementation

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