public StrategyCenter(DataCenter dataCenter) { this.dataCenter = dataCenter; this.strategyExecutorFactory = new StrategyExecutorFactory(this); this.strategyAssemblyMgr = StrategyMgrFactory.DefaultPluginMgr; this.strategyExecutorPool = new StrategyExecutorPool(); Uri uri = new Uri(dataCenter.DataCenterInfo.Uri); this.strategyResultStore = new StrategyResultStore_File(new StrategyDataPathUtils(uri.LocalPath)); }
private void btStrategy_Click(object sender, EventArgs e) { FormStrategy form = new FormStrategy(chartComponent); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { IStrategyExecutorPool pool = StrategyCenter.Default.GetStrategyExecutorPool(); FormStrategyExecutorState formRunState = new FormStrategyExecutorState(pool); formRunState.TopMost = true; formRunState.Show(); } }
/// <summary> /// 运行 /// </summary> public void Execute() { IStrategyExecutorPool pool = this.strategyCenter.GetStrategyExecutorPool(); for (int i = 0; i < executors.Count; i++) { IStrategyExecutor_Single executor = executors[i]; executor.OnStart += Executor_OnStart; executor.OnBarFinished += Executor_OnBarFinished; executor.OnDayFinished += Executor_OnDayFinished; executor.OnCanceled += Executor_OnCanceled; executor.OnFinished += Executor_OnFinished; executor.Strategy = strategy; pool.Queue(executor); } }
public FormStrategyExecutorState(IStrategyExecutorPool executorPool) { InitializeComponent(); }