public override void RunStrategy()
        {
            CleanupFiles();
            StartGUIThread();
            try {
                Starter starter = CreateStarterCallback();

                // Set run properties as in the GUI.
                starter.ProjectProperties.Starter.StartTime = new TimeStamp(1800, 1, 1);
                starter.ProjectProperties.Starter.EndTime   = new TimeStamp("2010-02-24 12:58:00.000");
                starter.DataFolder = "Test\\DataCache";
                starter.ProjectProperties.Starter.SetSymbols(Symbols);
                starter.ProjectProperties.Starter.IntervalDefault = Intervals.Minute1;
                starter.CreateChartCallback = new CreateChartCallback(HistoricalCreateChart);
                starter.ShowChartCallback   = new ShowChartCallback(HistoricalShowChart);
                // Run the loader.
                TestLimitOrderLoader loader = new TestLimitOrderLoader();
                starter.Run(loader);

                // Get the stategy
                strategy = loader.TopModel as ExampleOrderStrategy;
                LoadTransactions();
                LoadTrades();
                LoadBarData();
                LoadStats();
            } catch (Exception ex) {
                log.Error("Setup error.", ex);
                throw;
            }
        }
Ejemplo n.º 2
0
        public override void RunStrategy()
        {
            CleanupFiles(null, null);
            StartGUIThread();
            try {
                Starter starter = CreateStarterCallback();

                // Set run properties as in the GUI.
                starter.ProjectProperties.Starter.StartTime = new TimeStamp(1800, 1, 1);
                starter.ProjectProperties.Starter.EndTime   = new TimeStamp(2009, 06, 10);
                starter.DataFolder = "Test";
                starter.ProjectProperties.Starter.SetSymbols(Symbols);
                starter.ProjectProperties.Starter.IntervalDefault = new IntervalImpl(BarUnit.Tick, 25);
                starter.CreateChartCallback = new CreateChartCallback(HistoricalCreateChart);
                starter.ShowChartCallback   = new ShowChartCallback(HistoricalShowChart);
                // Run the loader.
                TestLimitOrderLoader loader = new TestLimitOrderLoader();
                starter.Run(loader);

                // Get the stategy
                strategy = loader.TopModel as ExampleOrderStrategy;
                LoadTransactions();
                LoadTrades();
                LoadBarData();
            } catch (Exception ex) {
                log.Error("Setup error.", ex);
                throw;
            }
        }