Ejemplo n.º 1
0
        public void TestSendNumLotsZeroDefault()
        {
            var order = new StopLimitOrder(new SOrderParameters());

            using var monitoredOrder = order.Monitor();
            order.Send(15, 15, 0);
            monitoredOrder.Should().Raise("OrderSent")
            .WithArgs <OrderInfo>(info => info.Size == 100);
        }
Ejemplo n.º 2
0
        public void TestSendIgnoreNumLots()
        {
            var order = new StopLimitOrder(new SOrderParameters());

            using var monitoredOrder = order.Monitor();
            order.Send(20, 19, 99);
            monitoredOrder.Should().Raise("OrderSent")
            .WithArgs <OrderInfo>(info => info.ConditionPrice == 20)
            .WithArgs <OrderInfo>(info => info.Price == 19)
            .WithArgs <OrderInfo>(info => info.Size == 100);
        }
Ejemplo n.º 3
0
        public void TestSendCustomNumLots()
        {
            var order = new StopLimitOrder(
                new SOrderParameters(Contracts.CreateUserSpecified(100), EOrderAction.Buy));

            using var monitoredOrder = order.Monitor();
            order.Send(17, 18, 25);
            monitoredOrder.Should().Raise("OrderSent")
            .WithArgs <OrderInfo>(info => info.ConditionPrice == 17)
            .WithArgs <OrderInfo>(info => info.Price == 18)
            .WithArgs <OrderInfo>(info => info.OrderAction == EOrderAction.Buy)
            .WithArgs <OrderInfo>(info => info.Size == 25);
        }
Ejemplo n.º 4
0
        public void TestSendWithUserDefinedSize()
        {
            var order = new StopLimitOrder(new SOrderParameters(
                                               Contracts.CreateUserSpecified(50), EOrderAction.Sell));

            using var monitoredOrder = order.Monitor();
            order.Send(15, 14);
            monitoredOrder.Should().Raise("OrderSent")
            .WithArgs <OrderInfo>(info => info.ConditionPrice == 15)
            .WithArgs <OrderInfo>(info => info.Price == 14)
            .WithArgs <OrderInfo>(info => info.OrderAction == EOrderAction.Sell)
            .WithArgs <OrderInfo>(info => info.Size == 50);
        }