예제 #1
0
 public LiquidationCommandsHandler(
     IAccountsCacheService accountsCache,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     ITradingEngine tradingEngine,
     OrdersCache ordersCache,
     ILog log,
     IAccountUpdateService accountUpdateService,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel,
     LiquidationHelper liquidationHelper,
     ILiquidationFailureExecutor failureExecutor)
 {
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty                 = chaosKitty;
     _tradingEngine              = tradingEngine;
     _ordersCache                = ordersCache;
     _log                        = log;
     _accountUpdateService       = accountUpdateService;
     _liquidationEndEventChannel = liquidationEndEventChannel;
     _liquidationHelper          = liquidationHelper;
     _failureExecutor            = failureExecutor;
 }
예제 #2
0
 public ValidateOrderService(
     IQuoteCacheService quoteCashService,
     IAccountUpdateService accountUpdateService,
     IAccountsCacheService accountsCacheService,
     ITradingInstrumentsCacheService accountAssetsCacheService,
     IAssetPairsCache assetPairsCache,
     OrdersCache ordersCache,
     IAssetPairDayOffService assetDayOffService,
     IIdentityGenerator identityGenerator,
     IDateService dateService,
     MarginTradingSettings marginSettings,
     ICfdCalculatorService cfdCalculatorService,
     IFeatureManager featureManager,
     CorrelationContextAccessor correlationContextAccessor)
 {
     _quoteCashService           = quoteCashService;
     _accountUpdateService       = accountUpdateService;
     _accountsCacheService       = accountsCacheService;
     _tradingInstrumentsCache    = accountAssetsCacheService;
     _assetPairsCache            = assetPairsCache;
     _ordersCache                = ordersCache;
     _assetDayOffService         = assetDayOffService;
     _identityGenerator          = identityGenerator;
     _dateService                = dateService;
     _marginSettings             = marginSettings;
     _cfdCalculatorService       = cfdCalculatorService;
     _featureManager             = featureManager;
     _correlationContextAccessor = correlationContextAccessor;
 }
예제 #3
0
 public ValidateOrderService(
     IQuoteCacheService quoteCashService,
     IAccountUpdateService accountUpdateService,
     IAccountsCacheService accountsCacheService,
     ITradingInstrumentsCacheService accountAssetsCacheService,
     IAssetPairsCache assetPairsCache,
     OrdersCache ordersCache,
     IAssetPairDayOffService assetDayOffService,
     IIdentityGenerator identityGenerator,
     IDateService dateService,
     MarginTradingSettings marginSettings,
     ICfdCalculatorService cfdCalculatorService)
 {
     _quoteCashService        = quoteCashService;
     _accountUpdateService    = accountUpdateService;
     _accountsCacheService    = accountsCacheService;
     _tradingInstrumentsCache = accountAssetsCacheService;
     _assetPairsCache         = assetPairsCache;
     _ordersCache             = ordersCache;
     _assetDayOffService      = assetDayOffService;
     _identityGenerator       = identityGenerator;
     _dateService             = dateService;
     _marginSettings          = marginSettings;
     _cfdCalculatorService    = cfdCalculatorService;
 }
예제 #4
0
 public PositionsConsumer(OrdersCache ordersCache,
                          IRabbitMqNotifyService rabbitMqNotifyService,
                          IConvertService convertService,
                          IDateService dateService,
                          IAccountsCacheService accountsCacheService,
                          IAccountUpdateService accountUpdateService,
                          IIdentityGenerator identityGenerator,
                          ICqrsSender cqrsSender,
                          IEventChannel <OrderCancelledEventArgs> orderCancelledEventChannel,
                          IEventChannel <OrderChangedEventArgs> orderChangedEventChannel,
                          IEventChannel <OrderActivatedEventArgs> orderActivatedEventChannel,
                          IMatchingEngineRouter meRouter,
                          ILog log)
 {
     _ordersCache                = ordersCache;
     _rabbitMqNotifyService      = rabbitMqNotifyService;
     _convertService             = convertService;
     _dateService                = dateService;
     _accountsCacheService       = accountsCacheService;
     _accountUpdateService       = accountUpdateService;
     _identityGenerator          = identityGenerator;
     _cqrsSender                 = cqrsSender;
     _orderCancelledEventChannel = orderCancelledEventChannel;
     _orderChangedEventChannel   = orderChangedEventChannel;
     _orderActivatedEventChannel = orderActivatedEventChannel;
     _meRouter = meRouter;
     _log      = log;
 }
예제 #5
0
 public LiquidationCommandsHandler(
     ITradingInstrumentsCacheService tradingInstrumentsCacheService,
     IAccountsCacheService accountsCache,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     IMatchingEngineRouter matchingEngineRouter,
     ITradingEngine tradingEngine,
     OrdersCache ordersCache,
     ILog log,
     IAccountUpdateService accountUpdateService,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel)
 {
     _tradingInstrumentsCacheService = tradingInstrumentsCacheService;
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty           = chaosKitty;
     _matchingEngineRouter = matchingEngineRouter;
     _tradingEngine        = tradingEngine;
     _ordersCache          = ordersCache;
     _log = log;
     _accountUpdateService       = accountUpdateService;
     _liquidationEndEventChannel = liquidationEndEventChannel;
 }
 public AccountsAmountUpdateReceiver(IAccountUpdateService accountUpdateService, IOptions <RabbitMqConfiguration> rabbitMqOptions)
 {
     _accountUpdateService = accountUpdateService;
     _hostname             = rabbitMqOptions.Value.Hostname;
     _queueName            = rabbitMqOptions.Value.QueueName;
     _username             = rabbitMqOptions.Value.UserName;
     _password             = rabbitMqOptions.Value.Password;
     InitializeRabbitMqListener();
 }
예제 #7
0
        public void OneTimeSetUp()
        {
            RegisterDependencies();
            _accountsCacheService = Container.Resolve<IAccountsCacheService>();
            _accountUpdateService = Container.Resolve<IAccountUpdateService>();
            _ordersCache = Container.Resolve<OrdersCache>();
            var bestPriceConsumer = Container.Resolve<IEventChannel<BestPriceChangeEventArgs>>();

            bestPriceConsumer.SendEvent(this, new BestPriceChangeEventArgs(new InstrumentBidAskPair { Instrument = "EURUSD", Bid = 1.02M, Ask = 1.04M }));
            bestPriceConsumer.SendEvent(this, new BestPriceChangeEventArgs(new InstrumentBidAskPair { Instrument = "BTCUSD", Bid = 905.1M, Ask = 905.35M }));
        }
예제 #8
0
 public WithdrawalCommandsHandler(
     IDateService dateService,
     IAccountsCacheService accountsCacheService,
     IAccountUpdateService accountUpdateService,
     IChaosKitty chaosKitty,
     IOperationExecutionInfoRepository operationExecutionInfoRepository)
 {
     _dateService                      = dateService;
     _accountsCacheService             = accountsCacheService;
     _accountUpdateService             = accountUpdateService;
     _chaosKitty                       = chaosKitty;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
 }
예제 #9
0
        public TradingEngine(
            IEventChannel <MarginCallEventArgs> marginCallEventChannel,
            IEventChannel <StopOutEventArgs> stopoutEventChannel,
            IEventChannel <OrderPlacedEventArgs> orderPlacedEventChannel,
            IEventChannel <OrderClosedEventArgs> orderClosedEventChannel,
            IEventChannel <OrderCancelledEventArgs> orderCancelledEventChannel,
            IEventChannel <OrderLimitsChangedEventArgs> orderLimitsChangesEventChannel,
            IEventChannel <OrderClosingEventArgs> orderClosingEventChannel,
            IEventChannel <OrderActivatedEventArgs> orderActivatedEventChannel,
            IEventChannel <OrderRejectedEventArgs> orderRejectedEventChannel,

            IValidateOrderService validateOrderService,
            IQuoteCacheService quoteCashService,
            IAccountUpdateService accountUpdateService,
            ICommissionService swapCommissionService,
            IEquivalentPricesService equivalentPricesService,
            IAccountsCacheService accountsCacheService,
            OrdersCache ordersCache,
            IAccountAssetsCacheService accountAssetsCacheService,
            IMatchingEngineRouter meRouter,
            IThreadSwitcher threadSwitcher,
            IContextFactory contextFactory,
            IAssetPairDayOffService assetPairDayOffService,
            ILog log)
        {
            _marginCallEventChannel         = marginCallEventChannel;
            _stopoutEventChannel            = stopoutEventChannel;
            _orderPlacedEventChannel        = orderPlacedEventChannel;
            _orderClosedEventChannel        = orderClosedEventChannel;
            _orderCancelledEventChannel     = orderCancelledEventChannel;
            _orderActivatedEventChannel     = orderActivatedEventChannel;
            _orderClosingEventChannel       = orderClosingEventChannel;
            _orderLimitsChangesEventChannel = orderLimitsChangesEventChannel;
            _orderRejectedEventChannel      = orderRejectedEventChannel;

            _quoteCashService          = quoteCashService;
            _accountUpdateService      = accountUpdateService;
            _swapCommissionService     = swapCommissionService;
            _validateOrderService      = validateOrderService;
            _equivalentPricesService   = equivalentPricesService;
            _accountsCacheService      = accountsCacheService;
            _ordersCache               = ordersCache;
            _accountAssetsCacheService = accountAssetsCacheService;
            _meRouter               = meRouter;
            _threadSwitcher         = threadSwitcher;
            _contextFactory         = contextFactory;
            _assetPairDayOffService = assetPairDayOffService;
            _log = log;
        }
예제 #10
0
 public ValidateOrderService(
     IQuoteCacheService quoteCashService,
     IAccountUpdateService accountUpdateService,
     IAccountsCacheService accountsCacheService,
     IAccountAssetsCacheService accountAssetsCacheService,
     IAssetPairsCache assetPairsCache,
     OrdersCache ordersCache,
     IAssetPairDayOffService assetDayOffService)
 {
     _quoteCashService          = quoteCashService;
     _accountUpdateService      = accountUpdateService;
     _accountsCacheService      = accountsCacheService;
     _accountAssetsCacheService = accountAssetsCacheService;
     _assetPairsCache           = assetPairsCache;
     _ordersCache        = ordersCache;
     _assetDayOffService = assetDayOffService;
 }
예제 #11
0
 public LiquidationFailureExecutor(
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IAccountsCacheService accountsCache,
     IDateService dateService,
     OrdersCache ordersCache,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel,
     IAccountUpdateService accountUpdateService,
     ILog log)
 {
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _ordersCache   = ordersCache;
     _liquidationEndEventChannel = liquidationEndEventChannel;
     _accountUpdateService       = accountUpdateService;
     _log = log;
 }
예제 #12
0
 public OvernightMarginService(
     IDateService dateService,
     ITradingEngine tradingEngine,
     IAccountsCacheService accountsCacheService,
     IAccountUpdateService accountUpdateService,
     IScheduleSettingsCacheService scheduleSettingsCacheService,
     IOvernightMarginParameterContainer overnightMarginParameterContainer,
     ILog log,
     IEventChannel <MarginCallEventArgs> marginCallEventChannel,
     OvernightMarginSettings overnightMarginSettings)
 {
     _dateService                       = dateService;
     _tradingEngine                     = tradingEngine;
     _accountsCacheService              = accountsCacheService;
     _accountUpdateService              = accountUpdateService;
     _scheduleSettingsCacheService      = scheduleSettingsCacheService;
     _overnightMarginParameterContainer = overnightMarginParameterContainer;
     _log = log;
     _marginCallEventChannel  = marginCallEventChannel;
     _overnightMarginSettings = overnightMarginSettings;
 }
예제 #13
0
 public AccountsProjection(
     IAccountsCacheService accountsCacheService,
     IEventChannel <AccountBalanceChangedEventArgs> accountBalanceChangedEventChannel,
     IConvertService convertService,
     IAccountUpdateService accountUpdateService,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     OrdersCache ordersCache,
     ILog log)
 {
     _accountsCacheService = accountsCacheService;
     _accountBalanceChangedEventChannel = accountBalanceChangedEventChannel;
     _convertService                   = convertService;
     _accountUpdateService             = accountUpdateService;
     _dateService                      = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty  = chaosKitty;
     _ordersCache = ordersCache;
     _log         = log;
 }