-
Notifications
You must be signed in to change notification settings - Fork 51
/
StrategyBatchNotificationFactory.cs
34 lines (31 loc) · 2.06 KB
/
StrategyBatchNotificationFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using DevelopmentInProgress.TradeView.Core.TradeStrategy;
using Microsoft.Extensions.Logging;
namespace DevelopmentInProgress.TradeServer.StrategyExecution.WebHost.Notification.Strategy
{
public class StrategyBatchNotificationFactory : BatchNotificationFactory<StrategyNotification>
{
private readonly IStrategyNotificationPublisher notificationPublisher;
private readonly ILoggerFactory loggerFactory;
public StrategyBatchNotificationFactory(IStrategyNotificationPublisher notificationPublisher, ILoggerFactory loggerFactory)
{
this.notificationPublisher = notificationPublisher;
this.loggerFactory = loggerFactory;
}
public override IBatchNotification<StrategyNotification> GetBatchNotifier(BatchNotificationType batchNotifierType)
{
return batchNotifierType switch
{
BatchNotificationType.StrategyLogger => new StrategyBatchLogger(loggerFactory),
BatchNotificationType.StrategyAccountInfoPublisher => new StrategyBatchAccountInfoPublisher(notificationPublisher),
BatchNotificationType.StrategyCustomNotificationPublisher => new StrategyBatchCustomNotificationPublisher(notificationPublisher),
BatchNotificationType.StrategyNotificationPublisher => new StrategyBatchNotificationPublisher(notificationPublisher),
BatchNotificationType.StrategyOrderBookPublisher => new StrategyBatchOrderBookPublisher(notificationPublisher),
BatchNotificationType.StrategyTradePublisher => new StrategyBatchTradePublisher(notificationPublisher),
BatchNotificationType.StrategyCandlesticksPublisher => new StrategyBatchCandlesticksPublisher(notificationPublisher),
BatchNotificationType.StrategyStatisticsPublisher => new StrategyBatchStatisticsPublisher(notificationPublisher),
BatchNotificationType.StrategyParameterUpdatePublisher => new StrategyBatchParameterUpdatePublisher(notificationPublisher),
_ => null,
};
}
}
}