Ejemplo n.º 1
0
        public void Handlers_Setup()
        {
            this.tradingData    = new TradingDataContext();
            this.outdateSeconds = 10;

            this.strategyHeader = new StrategyHeader(1, "Scalping", "BP12345-RF-01", "RTS-9.13_FT", 5);
            this.tradingData.Get <ICollection <StrategyHeader> >().Add(strategyHeader);

            UpdatePositionOnTrade updatePosition = new UpdatePositionOnTrade(this.tradingData, new NullLogger());
            MarkPartiallyFilledOrderAsOutdatedOnTick cancelHandler = new MarkPartiallyFilledOrderAsOutdatedOnTick(this.strategyHeader, this.outdateSeconds, this.tradingData, new NullLogger());
        }
Ejemplo n.º 2
0
        public void Handlers_Setup()
        {
            this.tradingData = new TradingDataContext();
            this.orderQueue  = new ObservableQueue <Order>();
            this.manager     = new MockOrderManager();

            OrderQueueProcessor   processor    = new OrderQueueProcessor(this.manager, this.tradingData, this.orderQueue, new NullLogger());
            UpdatePositionOnTrade tradeHandler = new UpdatePositionOnTrade(this.tradingData, new NullLogger());

            AddStrategies();

            AddSignals();
        }
Ejemplo n.º 3
0
        public void Handlers_Setup()
        {
            this.tradingData = new TradingDataContext();

            UpdatePositionOnTrade updateHandler = new UpdatePositionOnTrade(this.tradingData, new NullLogger());
            CancelOrderOnTrade    cancelHandler = new CancelOrderOnTrade(this.tradingData, new NullLogger());

            this.str1 = new StrategyHeader(1, "Strategy 1", "BP12345-RF-01", "RTS-9.13_FT", 10);
            this.tradingData.Get <ICollection <StrategyHeader> >().Add(this.str1);

            this.str2 = new StrategyHeader(2, "Strategy 2", "BP12345-RF-01", "Si-9.13_FT", 10);
            this.tradingData.Get <ICollection <StrategyHeader> >().Add(this.str2);

            this.str3 = new StrategyHeader(3, "Strategy 3", "BP12345-RF-01", "RTS-9.13_FT", 10);
            this.tradingData.Get <ICollection <StrategyHeader> >().Add(this.str3);

            this.s1 = new Signal(this.str1, BrokerDateTime.Make(DateTime.Now), TradeAction.Buy, OrderType.Limit, 150000, 0, 150100);
            this.tradingData.Get <ICollection <Signal> >().Add(this.s1);

            Order o1 = new Order(this.s1);

            this.tradingData.Get <ICollection <Order> >().Add(o1);

            Trade t1 = new Trade(o1, this.str1.Portfolio, this.str1.Symbol, this.s1.Limit, this.str1.Amount, BrokerDateTime.Make(DateTime.Now));

            this.tradingData.Get <ObservableHashSet <Trade> >().Add(t1);

            this.s2 = new Signal(this.str2, BrokerDateTime.Make(DateTime.Now), TradeAction.Sell, OrderType.Market, 33000, 0, 0);
            this.tradingData.Get <ICollection <Signal> >().Add(this.s2);

            Order o2 = new Order(this.s2);

            this.tradingData.Get <ICollection <Order> >().Add(o2);

            Trade t2 = new Trade(o2, this.str2.Portfolio, this.str2.Symbol, 33030, -this.str2.Amount, BrokerDateTime.Make(DateTime.Now));

            this.tradingData.Get <ObservableHashSet <Trade> >().Add(t2);

            this.s3 = new Signal(this.str3, BrokerDateTime.Make(DateTime.Now), TradeAction.Buy, OrderType.Market, 150000, 0, 0);
            this.tradingData.Get <ICollection <Signal> >().Add(this.s1);

            Order o3 = new Order(this.s3);

            this.tradingData.Get <ICollection <Order> >().Add(o3);

            Trade t3 = new Trade(o3, this.str3.Portfolio, this.str3.Symbol, this.s3.Limit, this.str3.Amount, BrokerDateTime.Make(DateTime.Now));

            this.tradingData.Get <ObservableHashSet <Trade> >().Add(t3);
        }
Ejemplo n.º 4
0
 public void Handlers_Setup()
 {
     this.tradingData = new TradingDataContext();
     UpdatePositionOnTrade  handler       = new UpdatePositionOnTrade(this.tradingData, new NullLogger());
     CancelStopOrderOnTrade cancelHandler = new CancelStopOrderOnTrade(this.tradingData, new NullLogger());
 }