Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpoofingRule"/> class.
 /// </summary>
 /// <param name="equitiesParameters">
 /// The equities parameters.
 /// </param>
 /// <param name="ruleContext">
 /// The rule 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="portfolioFactory">
 /// The portfolio factory.
 /// </param>
 /// <param name="analysisService">
 /// The analysis service.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="tradingHistoryLogger">
 /// The trading history logger.
 /// </param>
 public SpoofingRule(
     ISpoofingRuleEquitiesParameters equitiesParameters,
     ISystemProcessOperationRunRuleContext ruleContext,
     IUniverseAlertStream alertStream,
     IUniverseOrderFilter orderFilter,
     IUniverseEquityMarketCacheFactory equityMarketCacheFactory,
     IUniverseFixedIncomeMarketCacheFactory fixedIncomeMarketCacheFactory,
     RuleRunMode runMode,
     IPortfolioFactory portfolioFactory,
     IOrderAnalysisService analysisService,
     ILogger logger,
     ILogger <TradingHistoryStack> tradingHistoryLogger)
     : base(
         equitiesParameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromMinutes(30),
         equitiesParameters?.Windows?.BackwardWindowSize ?? TimeSpan.FromMinutes(30),
         equitiesParameters?.Windows?.FutureWindowSize ?? TimeSpan.Zero,
         Rules.Spoofing,
         EquityRuleSpoofingFactory.Version,
         "Spoofing Rule",
         ruleContext,
         equityMarketCacheFactory,
         fixedIncomeMarketCacheFactory,
         runMode,
         logger,
         tradingHistoryLogger)
 {
     this.equitiesParameters =
         equitiesParameters ?? throw new ArgumentNullException(nameof(equitiesParameters));
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     this.alertStream      = alertStream ?? throw new ArgumentNullException(nameof(alertStream));
     this.orderFilter      = orderFilter ?? throw new ArgumentNullException(nameof(orderFilter));
     this.portfolioFactory = portfolioFactory ?? throw new ArgumentNullException(nameof(portfolioFactory));
     this.analysisService  = analysisService ?? throw new ArgumentNullException(nameof(analysisService));
     this.ruleContext      = ruleContext ?? throw new ArgumentNullException(nameof(ruleContext));
 }
Пример #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));
 }
Пример #3
0
 public void Setup()
 {
     this._parameters           = A.Fake <IWashTradeRuleFixedIncomeParameters>();
     this._fixedIncomeOrderFile = A.Fake <IUniverseFixedIncomeOrderFilterService>();
     this._ruleCtx = A.Fake <ISystemProcessOperationRunRuleContext>();
     this._equityMarketCacheFactory      = A.Fake <IUniverseEquityMarketCacheFactory>();
     this._fixedIncomeMarketCacheFactory = A.Fake <IUniverseFixedIncomeMarketCacheFactory>();
     this._alertStream        = A.Fake <IUniverseAlertStream>();
     this._clusteringService  = A.Fake <IClusteringService>();
     this._portfolioFactory   = A.Fake <IPortfolioFactory>();
     this._logger             = new NullLogger <FixedIncomeHighProfitsRule>();
     this._tradingStackLogger = new NullLogger <TradingHistoryStack>();
 }
Пример #4
0
        public void Setup()
        {
            this._orderFilterService   = A.Fake <IUniverseEquityOrderFilterService>();
            this._equityFactory        = A.Fake <IUniverseEquityMarketCacheFactory>();
            this._fixedIncomeFactory   = A.Fake <IUniverseFixedIncomeMarketCacheFactory>();
            this._portfolioFactory     = A.Fake <IPortfolioFactory>();
            this._orderAnalysisService = A.Fake <IOrderAnalysisService>();
            this._logger = new NullLogger <SpoofingRule>();
            this._tradingHistoryLogger = new NullLogger <TradingHistoryStack>();

            this._spoofingEquitiesParameters = A.Fake <ISpoofingRuleEquitiesParameters>();
            this._ruleCtx     = A.Fake <ISystemProcessOperationRunRuleContext>();
            this._alertStream = A.Fake <IUniverseAlertStream>();
        }
        private void Setup()
        {
            this._orderFilterService = A.Fake <IUniverseFixedIncomeOrderFilterService>();
            this._ruleCtx            = A.Fake <ISystemProcessOperationRunRuleContext>();
            this._alertStream        = A.Fake <IUniverseAlertStream>();

            this._portfolioFactory         = new PortfolioFactory();
            this._clusteringService        = new ClusteringService();
            this._equityMarketCacheFactory = new UniverseEquityMarketCacheFactory(
                new StubRuleRunDataRequestRepository(),
                new StubRuleRunDataRequestRepository(),
                new NullLogger <UniverseEquityMarketCacheFactory>());
            this._fixedIncomeMarketCacheFactory = new UniverseFixedIncomeMarketCacheFactory(
                new StubRuleRunDataRequestRepository(),
                new StubRuleRunDataRequestRepository(),
                new NullLogger <UniverseFixedIncomeMarketCacheFactory>());
        }
Пример #6
0
 public EquityRuleSpoofingFactory(
     IUniverseEquityMarketCacheFactory equityFactory,
     IUniverseFixedIncomeMarketCacheFactory fixedIncomeFactory,
     IUniverseEquityOrderFilterService orderFilterService,
     IPortfolioFactory portfolioFactory,
     IOrderAnalysisService analysisService,
     ILogger <SpoofingRule> logger,
     ILogger <TradingHistoryStack> tradingHistoryLogger)
 {
     this._orderFilterService =
         orderFilterService ?? throw new ArgumentNullException(nameof(orderFilterService));
     this._equityFactory        = equityFactory ?? throw new ArgumentNullException(nameof(equityFactory));
     this._fixedIncomeFactory   = fixedIncomeFactory ?? throw new ArgumentNullException(nameof(fixedIncomeFactory));
     this._portfolioFactory     = portfolioFactory ?? throw new ArgumentNullException(nameof(portfolioFactory));
     this._orderAnalysisService = analysisService ?? throw new ArgumentNullException(nameof(analysisService));
     this._logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this._tradingHistoryLogger =
         tradingHistoryLogger ?? throw new ArgumentNullException(nameof(tradingHistoryLogger));
 }
 public PortfolioEntityFactory(IPortfolioFactory portfolioFactory)
 {
     _PortfolioFactory = portfolioFactory;
 }