private void RunStrategy(IStrategy strategy) { IDataPackage_Code dataPackage = this.compChart1.CompChartData.DataPackage; StrategyReferedPeriods referedPeriods = new StrategyReferedPeriods(); //compChart1.KlinePeriod KLinePeriod period = compChart1.GetKLinePeriod(); referedPeriods.UsedKLinePeriods.Add(period); //referedPeriods.UsedKLinePeriods.Add(this.n) StrategyForwardPeriod forwardPeriod = new StrategyForwardPeriod(false, period); IStrategyExecutor strategyRunner = StrategyCenter.Default.GetStrategyExecutorFactory_History().CreateExecutorByDataPackage(dataPackage, referedPeriods, forwardPeriod, compChart1.StrategyHelper); //compChart1.StrategyHelper.DrawHelper.ClearShapes(); //compChart1.CurrentPriceRectDrawer.cl //compChart1.CurrentPriceRectDrawer.ClearPriceShapes(); if (strategy is StrategyAbstract) { ((StrategyAbstract)strategy).MainKLinePeriod = period; } strategyRunner.SetStrategy(strategy); strategyRunner.Run(); compChart1.Refresh(); }
private void StrategyRunner_ExecuteFinished(IStrategy strategy, StrategyExecuteFinishedArguments args) { compChart1.Refresh(); }