copyWithState method

MatexBaseCoreState copyWithState(
  1. MatexBaseCoreState state
)

Implementation

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