private void ApplySettings() { var securities = EmulatorSecurities.ToArray(); if (EmulationConnector.State == EmulationStates.Stopped || EmulationConnector.State == EmulationStates.Starting) { var realData = false; switch (EmulationSettings.TradeDataMode) { case EmulationMarketDataModes.Generate: { foreach (var sec in securities) { EmulationConnector.RegisterTrades(new RandomWalkTradeGenerator(EmulationConnector.GetSecurityId(sec))); } break; } case EmulationMarketDataModes.Storage: { realData = true; break; } } switch (EmulationSettings.DepthDataMode) { case EmulationMarketDataModes.Generate: { foreach (var sec in securities) { EmulationConnector.RegisterMarketDepth(new TrendMarketDepthGenerator(EmulationConnector.GetSecurityId(sec))); } break; } case EmulationMarketDataModes.Storage: realData = true; break; } if (EmulationSettings.OrderLogDataMode == EmulationMarketDataModes.Storage) { realData = true; } if (!realData) { EmulationConnector.StorageRegistry = null; } } EmulationConnector.MarketEmulator.Settings.UseCandlesTimeFrame = EmulationSettings.UseCandlesTimeFrame; EmulationConnector.MarketDataAdapter.SessionHolder.MarketTimeChangedInterval = EmulationSettings.MarketTimeChangedInterval; EmulationConnector.LogLevel = EmulationSettings.LogLevel; MemoryStatistics.Instance.LogLevel = EmulationSettings.LogLevel; }
/// <summary> /// Остановить эмуляцию. /// </summary> public void Stop() { _cancelEmulation = true; EmulationConnector.Stop(); }
public void PauseEmulation() { EmulationConnector.Suspend(); }