public void SetDeliveryDate_test() { StrategyHeader strategyHeader = new StrategyHeader(1, "Sample strategyHeader", "BP12345-RF-01", "RTS-9.13_FT", 10); this.tradingData.Get <ICollection <StrategyHeader> >().Add(strategyHeader); Signal signal = new Signal(strategyHeader, BrokerDateTime.Make(DateTime.Now), TradeAction.Buy, OrderType.Market, 150000, 0, 0); this.tradingData.Get <ICollection <Signal> >().Add(signal); Order order = new Order(signal, 150); this.tradingData.Get <ICollection <Order> >().Add(order); Assert.IsFalse(order.IsDelivered); Assert.AreEqual(0, this.tradingData.Get <IEnumerable <OrderDeliveryConfirmation> >().Count()); OrderSucceeded os = new OrderSucceeded(order.Id, "12345"); this.rawData.GetData <OrderSucceeded>().Add(os); Assert.AreEqual(1, this.tradingData.Get <IEnumerable <OrderDeliveryConfirmation> >().Count()); OrderDeliveryConfirmation confirmation = this.tradingData.Get <IEnumerable <OrderDeliveryConfirmation> >().Last(); Assert.AreEqual(order.Id, confirmation.OrderId); Assert.AreEqual(order, confirmation.Order); Assert.AreEqual(os.DateTime, confirmation.DateTime); }
public void OrderSucceeded_constructor_test() { OrderSucceeded os = new OrderSucceeded(35, "9028347"); Assert.AreEqual(35, os.Cookie); Assert.AreEqual("9028347", os.OrderId); Assert.AreEqual(BrokerDateTime.Make(DateTime.Now).Date, os.DateTime.Date); }
protected void OnOrderSucceeded(TradingData data) { OrderSucceeded?.Invoke(data); #if DEBUG if (_settings.ProductionMode) { Bot.SaveSettings(_settings); } #endif #if RELEASE Bot.SaveSettings(_settings); #endif }