/// <summary>
 /// Initializes a new instance of the <see cref="CancelledOrderRule"/> class.
 /// </summary>
 /// <param name="parameters">
 /// The parameters.
 /// </param>
 /// <param name="operationContext">
 /// The operation context.
 /// </param>
 /// <param name="alertStream">
 /// The alert stream.
 /// </param>
 /// <param name="orderFilter">
 /// The order filter.
 /// </param>
 /// <param name="equityMarketCacheFactory">
 /// The market cache factory.
 /// </param>
 /// <param name="fixedIncomeMarketCacheFactory">
 /// The market cache factory.
 /// </param>
 /// <param name="runMode">
 /// The run mode.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="tradingHistoryLogger">
 /// The trading history logger.
 /// </param>
 public CancelledOrderRule(
     ICancelledOrderRuleEquitiesParameters parameters,
     ISystemProcessOperationRunRuleContext operationContext,
     IUniverseAlertStream alertStream,
     IUniverseOrderFilter orderFilter,
     IUniverseEquityMarketCacheFactory equityMarketCacheFactory,
     IUniverseFixedIncomeMarketCacheFactory fixedIncomeMarketCacheFactory,
     RuleRunMode runMode,
     ILogger <CancelledOrderRule> logger,
     ILogger <TradingHistoryStack> tradingHistoryLogger)
     : base(
         parameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromMinutes(60),
         parameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromMinutes(60),
         parameters?.Windows?.FutureWindowSize ?? TimeSpan.Zero,
         Rules.CancelledOrders,
         Versioner.Version(2, 0),
         "Cancelled Order Rule",
         operationContext,
         equityMarketCacheFactory,
         fixedIncomeMarketCacheFactory,
         runMode,
         logger,
         tradingHistoryLogger)
 {
     this.parameters       = parameters ?? throw new ArgumentNullException(nameof(parameters));
     this.operationContext = operationContext ?? throw new ArgumentNullException(nameof(operationContext));
     this.alertStream      = alertStream ?? throw new ArgumentNullException(nameof(alertStream));
     this.orderFilter      = orderFilter ?? throw new ArgumentNullException(nameof(orderFilter));
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FixedIncomeWashTradeRule"/> class.
 /// </summary>
 /// <param name="parameters">
 /// The parameters.
 /// </param>
 /// <param name="orderFilterService">
 /// The order filter service.
 /// </param>
 /// <param name="ruleContext">
 /// The rule context.
 /// </param>
 /// <param name="equityFactory">
 /// The factory.
 /// </param>
 /// <param name="fixedIncomeFactory">
 /// The factory.
 /// </param>
 /// <param name="runMode">
 /// The run mode.
 /// </param>
 /// <param name="alertStream">
 /// The alert stream.
 /// </param>
 /// <param name="clusteringService">
 /// The clustering service.
 /// </param>
 /// <param name="portfolioFactory">
 /// The portfolio factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="tradingStackLogger">
 /// The trading stack logger.
 /// </param>
 public FixedIncomeWashTradeRule(
     IWashTradeRuleFixedIncomeParameters parameters,
     IUniverseFixedIncomeOrderFilterService orderFilterService,
     ISystemProcessOperationRunRuleContext ruleContext,
     IUniverseEquityMarketCacheFactory equityFactory,
     IUniverseFixedIncomeMarketCacheFactory fixedIncomeFactory,
     RuleRunMode runMode,
     IUniverseAlertStream alertStream,
     IClusteringService clusteringService,
     IPortfolioFactory portfolioFactory,
     ILogger <FixedIncomeWashTradeRule> logger,
     ILogger <TradingHistoryStack> tradingStackLogger)
     : base(
         parameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromDays(1),
         parameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromDays(1),
         parameters?.Windows?.FutureWindowSize ?? TimeSpan.Zero,
         Rules.FixedIncomeWashTrades,
         Versioner.Version(1, 0),
         $"{nameof(FixedIncomeWashTradeRule)}",
         ruleContext,
         equityFactory,
         fixedIncomeFactory,
         runMode,
         logger,
         tradingStackLogger)
 {
     this.parameters         = parameters ?? throw new ArgumentNullException(nameof(parameters));
     this.orderFilterService = orderFilterService ?? throw new ArgumentNullException(nameof(orderFilterService));
     this.alertStream        = alertStream ?? throw new ArgumentNullException(nameof(alertStream));
     this.clusteringService  = clusteringService ?? throw new ArgumentNullException(nameof(clusteringService));
     this.portfolioFactory   = portfolioFactory ?? throw new ArgumentNullException(nameof(portfolioFactory));
     this.logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HighVolumeVenueFilter"/> class.
 /// </summary>
 /// <param name="timeWindows">
 /// The time windows.
 /// </param>
 /// <param name="decimalRangeRuleFilter">
 /// The decimal range rule filter.
 /// </param>
 /// <param name="universeOrderFilter">
 /// The universe order filter.
 /// </param>
 /// <param name="runRuleContext">
 /// The run rule context.
 /// </param>
 /// <param name="equityMarketCacheFactory">
 /// The universe market cache factory.
 /// </param>
 /// <param name="fixedIncomeMarketCacheFactory">
 /// The universe market cache factory.
 /// </param>
 /// <param name="ruleRunMode">
 /// The rule run mode.
 /// </param>
 /// <param name="marketTradingHoursService">
 /// The market trading hours service.
 /// </param>
 /// <param name="dataRequestsSubscriber">
 /// The data requests subscriber.
 /// </param>
 /// <param name="source">
 /// The source.
 /// </param>
 /// <param name="stackLogger">
 /// The stack logger.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public HighVolumeVenueFilter(
     TimeWindows timeWindows,
     DecimalRangeRuleFilter decimalRangeRuleFilter,
     IUniverseOrderFilter universeOrderFilter,
     ISystemProcessOperationRunRuleContext runRuleContext,
     IUniverseEquityMarketCacheFactory equityMarketCacheFactory,
     IUniverseFixedIncomeMarketCacheFactory fixedIncomeMarketCacheFactory,
     RuleRunMode ruleRunMode,
     IMarketTradingHoursService marketTradingHoursService,
     IUniverseDataRequestsSubscriber dataRequestsSubscriber,
     DataSource source,
     ILogger <TradingHistoryStack> stackLogger,
     ILogger <HighVolumeVenueFilter> logger)
     : base(
         timeWindows.BackwardWindowSize,
         timeWindows.BackwardWindowSize,
         timeWindows.FutureWindowSize,
         Domain.Surveillance.Scheduling.Rules.UniverseFilter,
         Versioner.Version(1, 0),
         nameof(HighVolumeVenueFilter),
         runRuleContext,
         equityMarketCacheFactory,
         fixedIncomeMarketCacheFactory,
         ruleRunMode,
         logger,
         stackLogger)
 {
     this.eventExpiration        = this.TradeBackwardWindowSize + this.TradeBackwardWindowSize + TimeSpan.FromDays(3);
     this.tradingHoursService    = marketTradingHoursService ?? throw new ArgumentNullException(nameof(marketTradingHoursService));
     this.decimalRangeRuleFilter = decimalRangeRuleFilter ?? DecimalRangeRuleFilter.None();
     this.orderFilter            = universeOrderFilter ?? throw new ArgumentNullException(nameof(universeOrderFilter));
     this.dataRequestSubscriber  = dataRequestsSubscriber ?? throw new ArgumentNullException(nameof(dataRequestsSubscriber));
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.UniverseEventsPassedFilter = new HashSet <Order>();
     this.source = source;
 }