Пример #1
0
        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));
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        /// <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);
            }
        }
Пример #4
0
 public FormStrategyExecutorState(IStrategyExecutorPool executorPool)
 {
     InitializeComponent();
 }