コード例 #1
0
 public void InterfaceOk()
 {
     OrderTransaction trans = new OrderTransaction();
     trans.Direction = OrderDirection.Buy;
     IPositionInventory lifo = new PositionInventoryLifo();
     lifo.Add(trans);
     var count = lifo.BuysCount();
     Assert.IsTrue(lifo.BuysCount() == 1);
     trans = lifo.RemoveBuy();
     Assert.IsNotNull(trans);
     Assert.IsTrue(lifo.BuysCount() == 0);
 }
コード例 #2
0
        public IPositionInventory OpenPosition(OrderTransaction trans, PositionInventoryMethod positionResolution)
        {
            IPositionInventory position;

            if (positionResolution == PositionInventoryMethod.Fifo)
            {
                position = new PositionInventoryFifo();
            }
            else
            {
                position = new PositionInventoryLifo();
            }
            position.Add(trans);
            return(position);
        }
コード例 #3
0
        public IPositionInventory OpenPosition(OrderTransaction trans, PositionInventoryMethod positionResolution)
        {
            IPositionInventory position;

            if (positionResolution == PositionInventoryMethod.Fifo)
                position = new PositionInventoryFifo();
            else
            {
                position = new PositionInventoryLifo();
            }
            position.Add(trans);
            return position;
        }
コード例 #4
0
 public void Setup()
 {
     lifo = new PositionInventoryLifo();
     fifo = new PositionInventoryFifo();
 }