Ejemplo n.º 1
0
        public override void CopyFrom(StrategySetting settings)
        {
            LinerRegStrategySettings otherSettings = (LinerRegStrategySettings)settings;

            Symbol         = otherSettings.Symbol;
            Period         = otherSettings.Period;
            Number         = otherSettings.Number;
            OpenThreshold  = otherSettings.OpenThreshold;
            CloseThreshold = otherSettings.CloseThreshold;
        }
Ejemplo n.º 2
0
        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);
        }