Esempio n. 1
0
        public void Setup()
        {
            this.tradingData = new TradingDataContext();
            this.signalQueue = new ObservableQueue <Signal>();
            this.orderQueue  = new ObservableQueue <Order>();
            this.schedule    = new AlwaysTimeToTradeSchedule();

            SignalQueueProcessor processor = new SignalQueueProcessor(this.signalQueue, this.orderQueue, this.tradingData, this.schedule, new NullLogger());

            AddStrategies();
        }
Esempio n. 2
0
        public SignalQueueProcessor(ObservableQueue <Signal> signalQueue,
                                    ObservableQueue <Order> orderQueue,
                                    IDataContext tradingData,
                                    ITradingSchedule schedule,
                                    ILogger logger)
        {
            this.signalQueue = signalQueue;
            this.orderQueue  = orderQueue;
            this.tradingData = tradingData;
            this.schedule    = schedule;
            this.logger      = logger;

            this.signalQueue.RegisterObserver(this);
        }
Esempio n. 3
0
        public TraderBase(IDataContext tradingData,
                          ObservableQueue <Signal> signalQueue,
                          ObservableQueue <Order> orderQueue,
                          IOrderManager orderManager,
                          ITradingSchedule schedule,
                          ILogger logger)
        {
            this.signalProcessor =
                new SignalQueueProcessor(signalQueue, orderQueue, tradingData, schedule, logger);

            this.orderProcessor =
                new OrderQueueProcessor(orderManager, tradingData, orderQueue, logger);

            this.updatePositionHandler =
                new UpdatePositionOnTrade(tradingData, logger);

            this.rejectOrderHandler =
                new RejectOrderOnOrderRejection(tradingData, logger);

            this.cancelOrderRequestHandler =
                new CancelOrderOnCancellationRequest(orderManager, tradingData, logger);

            this.cancelOrderHandler =
                new CancelOrderOnCancellationConfirmation(tradingData, logger);

            this.orderDeliveryConfirmationHandler =
                new UpdateOrderOnOrderDeliveryConfirmation(tradingData, logger);

            this.cancelOrderOnTrade =
                new CancelOrderOnTrade(tradingData, logger);

            this.placeCancelOrderRequestOnTick =
                new PlaceCancelOrderRequestOnTick(tradingData, logger);

            this.cancelStopOnTrade =
                new CancelStopOrderOnTrade(tradingData, logger);
        }
Esempio n. 4
0
 public RawOrderFactory(ITradingSchedule schedule)
 {
     this.schedule = schedule;
 }