Beispiel #1
0
        public ServerManager(IServerMonitor serverMonitor,
                             IBatchNotification <ServerNotification> serverBatchNotificationPublisher,
                             ITradeStrategyCacheManager tradeStrategyCacheManager,
                             StrategyNotificationHub strategyNotificationHub,
                             ServerNotificationHub serverNotificationHub)
        {
            ServerMonitor = serverMonitor;

            this.serverBatchNotificationPublisher = serverBatchNotificationPublisher;
            this.tradeStrategyCacheManager        = tradeStrategyCacheManager;
            this.strategyNotificationHub          = strategyNotificationHub;
            this.serverNotificationHub            = serverNotificationHub;

            disposables = new List <IDisposable>();

            ObserverTradeStrategyCacheManager();
            ObserverStrategyNotificationHub();
            ObserverServerNotificationHub();
        }
Beispiel #2
0
        public StrategyRunner(
            IBatchNotificationFactory <StrategyNotification> batchNotificationFactory,
            ISubscriptionsCacheManager subscriptionsCacheManager,
            ITradeStrategyCacheManager tradeStrategyCacheManager)
        {
            if (batchNotificationFactory == null)
            {
                throw new ArgumentNullException(nameof(batchNotificationFactory));
            }

            this.subscriptionsCacheManager = subscriptionsCacheManager ?? throw new ArgumentNullException(nameof(subscriptionsCacheManager));
            this.tradeStrategyCacheManager = tradeStrategyCacheManager ?? throw new ArgumentNullException(nameof(tradeStrategyCacheManager));

            strategyLogger = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyLogger);
            strategyAccountInfoPublisher        = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyAccountInfoPublisher);
            strategyCustomNotificationPublisher = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyCustomNotificationPublisher);
            strategyNotificationPublisher       = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyNotificationPublisher);
            strategyOrderBookPublisher          = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyOrderBookPublisher);
            strategyTradePublisher           = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyTradePublisher);
            strategyStatisticsPublisher      = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyStatisticsPublisher);
            strategyCandlesticksPublisher    = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyCandlesticksPublisher);
            strategyParameterUpdatePublisher = batchNotificationFactory.GetBatchNotifier(BatchNotificationType.StrategyParameterUpdatePublisher);
        }