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(); }
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); }
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); }
public RawOrderFactory(ITradingSchedule schedule) { this.schedule = schedule; }