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