copyWith method
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? annualDividendIncrease,
- double? annualContribution,
- double? dividendYield,
- int? yearsToGrow,
- double? taxExemptAmountPerYear,
- double? totalDividend,
- 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,
);
}