public static StrategySetting Create(string name) { StrategySetting setting = null; switch (name) { case ArbitrageStrategyName: setting = new ArbitrageStrategySetting(); break; case ChangePositionStrategyName: setting = new ChangePositionSetting(); break; case ScalperStrategyName: setting = new ScalperSetting(); break; case MACDHistSlopeStrategyName: setting = new MACDHistSlopeStrategySetting(); break; case WMATrendStrategyName: setting = new WMATrendStrategySettings(); break; case LinerRegressionStrategyName: setting = new LinerRegStrategySettings(); break; case ASCTrendStrategyName: setting = new ASCTrendStrategySettings(); break; case RangeTrendStrategyName: setting = new RangeTrendStrategySettings(); break; case ManualStrategyName: setting = new ManualStrategySetting(); break; default: throw new ArgumentException(string.Format("Unexpected strategy setting ({0})", name)); } return(setting); }
public MACDHistSlopeSettingsVM() { _fastStdDiffEditCommand = new DelegateCommand(delegate { double val; if (CalcStdDiffVal(out val)) { MACDHistSlopeStrategySetting setting = (MACDHistSlopeStrategySetting)this.Settings; setting.FastStdDiff = val; } }); _slowStdDiffEditCommand = new DelegateCommand(delegate { double val; if (CalcStdDiffVal(out val)) { MACDHistSlopeStrategySetting setting = (MACDHistSlopeStrategySetting)this.Settings; setting.SlowStdDiff = val; } }); }
public override void CopyFrom(StrategySetting settings) { MACDHistSlopeStrategySetting otherSettings = (MACDHistSlopeStrategySetting)settings; Symbol = otherSettings.Symbol; MACD_Short = otherSettings.MACD_Short; MACD_Long = otherSettings.MACD_Long; MACD_M = otherSettings.MACD_M; FastPeriod = otherSettings.FastPeriod; FastStdDiff = otherSettings.FastStdDiff; FastShortSeed = otherSettings.FastShortSeed; FastLongSeed = otherSettings.FastLongSeed; FastSignalSeed = otherSettings.FastSignalSeed; FastAngleThreshold = otherSettings.FastAngleThreshold; SlowPeriod = otherSettings.SlowPeriod; SlowStdDiff = otherSettings.SlowStdDiff; SlowShortSeed = otherSettings.SlowShortSeed; SlowLongSeed = otherSettings.SlowLongSeed; SlowSignalSeed = otherSettings.SlowSignalSeed; SlowAngleThreshold = otherSettings.SlowAngleThreshold; FastReverseAngle = otherSettings.FastReverseAngle; TrailingStopValue = otherSettings.TrailingStopValue; }