コード例 #1
0
        private void OnEmulationConnectorOnLookupSecuritiesResult(Exception exception, IEnumerable <Security> securities)
        {
            EmulationConnector.LookupSecuritiesResult -= OnEmulationConnectorOnLookupSecuritiesResult;

            // start strategy before emulation started
            OnEmulationStarting();

            // start historical data loading when connection established successfully and all data subscribed
            EmulationConnector.Start();
        }
コード例 #2
0
        private void TryStartNextBatch()
        {
            if (!_batches.MoveNext() || _cancelEmulation)
            {
                State = EmulationStates.Stopping;
                State = EmulationStates.Stopped;
                return;
            }

            _batch = _batches.Current.ToArray();
            _currentBatch++;

            InitAdapters(_batch);

            EmulationConnector.Connect();
            EmulationConnector.Start(EmulationSettings.StartTime, EmulationSettings.StopTime);
        }
コード例 #3
0
        public void StartEmulation()
        {
            if (EmulationConnector.State == EmulationStates.Suspended)
            {
                EmulationConnector.Start();
            }
            else
            {
                if (!CanStart)
                {
                    return;
                }

                CanStart = false;

                CreateEmulationSession();

                _basketEmulation.Start(GetStrategies().ToEx(Strategies.Count));
            }
        }