Beispiel #1
0
        public override bool onStart(int ticks)
        {
            spreadAnalyzer = new SpreadAnalyzer(100);
            strategyTime   = new StrategyTime(param["ProhibitedStartHour"], param["ProhibitedStartMinute"], param["ProhibitedDuration"], (param.Keys.Contains("GMT") ? param["GMT"] : 0), 31);

            return(true);
        }
Beispiel #2
0
        public override bool onStart(int ticks)
        {
            ExtremumPoint  = new ExtremumPointStrategy((param["TP"] * param["TPCoefExtremum"]) / 10);
            ExtremumPoint2 = new ExtremumPointStrategy((param["TP"] * param["TPCoefExtremum2"]) / 10);
            strategyTime   = new StrategyTime(param["ProhibitedStartHour"], param["ProhibitedStartMinute"], param["ProhibitedDuration"], (param.Keys.Contains("GMT") ? param["GMT"] : 0), 31);
            spreadAnalyzer = new SpreadAnalyzer(100);

            InitExtremum(1000);
            if (logger != null)
            {
                this.logger.AddMessage("Start strategy with parameter {0}", param.ToString());
            }

            return(true);
        }
        public override bool onStart(int ticks)
        {
            ExtremumPoint = new ExtremumPointStrategy(param["TP"]);
            InitExtremum(param["NumberInitPeriods"]);
            if (ExtremumPoint.Count <= param["NumberEndFluctuation"])
            {
                logger.AddMessage("onStart error. Number of extremums in history is too low = " + ExtremumPoint.Count.ToString());
                return(false);
            }

            fluctuationList = new FluctuationCollection(param["NumberStartFluctuation"], param["NumberEndFluctuation"]);

            for (int i = fluctuationList.StartIndex; i < fluctuationList.EndIndex; i++)
            {
                Meta.ObjectCreate(GetHLineName(i), MetaObjectType.OBJ_HLINE, 0, DateTime.Now, 148000, FxAdvisorCore.Convertor.startTime, 0, FxAdvisorCore.Convertor.startTime, 0).ToString();
                Meta.ObjectSetText(GetHLineName(i), i.ToString(), 10, "", 0);
            }
            newsPeriod     = new NewsPeriods(param.NewsFilePath, 300, 600, base.Symbol, base.TestingMode, (param.Keys.Contains("GMT") ? param["GMT"] : 0), this.logger);
            spreadAnalyzer = new SpreadAnalyzer(100);
            strategyTime   = new StrategyTime(param["ProhibitedStartHour"], param["ProhibitedStartMinute"], param["ProhibitedDuration"], (param.Keys.Contains("GMT") ? param["GMT"] : 0), 31);

            return(true);
        }