Beispiel #1
0
        protected override void CreateOrderRelation(Order closeOrder, Commands.AddOrderCommandBase command)
        {
            var deliveryCommand = (Commands.AddCancelDeliveryWithShortSellOrderCommand)command;

            foreach (var eachOrderRelationRecord in deliveryCommand.OrderRelations)
            {
                var addCommand = command.AddOrderRelationFactory.Create(eachOrderRelationRecord.OpenOrder, command.Result, eachOrderRelationRecord.ClosedLot);
                addCommand.Execute();
            }
        }
        protected override void CreateOrderRelation(Order closeOrder, Commands.AddOrderCommandBase command)
        {
            var multipleCloseCommand = (Commands.AddMultipleCloseOrderCommandBase)command;

            foreach (var eachOrderRelation in multipleCloseCommand.OrderRelations)
            {
                var addOrderRelationCommand = command.AddOrderRelationFactory.Create(eachOrderRelation.OpenOrder, closeOrder, eachOrderRelation.ClosedLot);
                addOrderRelationCommand.Execute();
            }
        }
Beispiel #3
0
        public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
        {
            var deliveryCommand = (Commands.AddCancelDeliveryWithShortSellOrderCommand)command;
            var constructParams = (PhysicalOrderConstructParams)command.ConstructParams;

            constructParams.PhysicalSettings = new PhysicalConstructParams();
            constructParams.Id           = Guid.NewGuid();
            constructParams.Code         = command.GenerateOrderCode();
            constructParams.TradeOption  = deliveryCommand.TradeOption;
            constructParams.Phase        = iExchange.Common.OrderPhase.Executed;
            constructParams.IsOpen       = deliveryCommand.IsOpen;
            constructParams.IsBuy        = deliveryCommand.IsBuy;
            constructParams.SetPrice     = deliveryCommand.SetPrice;
            constructParams.ExecutePrice = deliveryCommand.ExecutePrice;
            constructParams.Lot          = deliveryCommand.Lot;
            constructParams.OriginalLot  = deliveryCommand.Lot;
            constructParams.LotBalance   = deliveryCommand.LotBalance;
            constructParams.PhysicalSettings.PhysicalTradeSide = iExchange.Common.PhysicalTradeSide.Delivery;
            constructParams.PhysicalSettings.PhysicalRequestId = deliveryCommand.PhysicalRequestId;
            this.CreateOrder(command);
        }
Beispiel #4
0
        protected override void CreateOrderRelation(Order closeOrder, Commands.AddOrderCommandBase command)
        {
            var lmtQuantiryOnMaxLotChangeOrderCommand = (Commands.AddLmtQuantiryOnMaxLotChangeOrderCommandBase)command;
            List <OrderRelation> orderRelations       = new List <OrderRelation>(lmtQuantiryOnMaxLotChangeOrderCommand.OriginOrder.OrderRelations);

            orderRelations.Sort(OrderRelation.AutoCloseComparer);
            decimal totalCloseLot = lmtQuantiryOnMaxLotChangeOrderCommand.Lot;

            foreach (OrderRelation sourceOrderRelation in orderRelations)
            {
                if (sourceOrderRelation.ClosedLot < totalCloseLot)
                {
                    var orderRelationCommand = command.AddOrderRelationFactory.Create(closeOrder, sourceOrderRelation.OpenOrder, sourceOrderRelation.ClosedLot);
                    orderRelationCommand.Execute();
                    totalCloseLot -= sourceOrderRelation.ClosedLot;
                }
                else
                {
                    var orderRelationCommand = command.AddOrderRelationFactory.Create(closeOrder, sourceOrderRelation.OpenOrder, totalCloseLot);
                    orderRelationCommand.Execute();
                    break;
                }
            }
        }
Beispiel #5
0
 public override void VisitAddBOOrderCommand(Commands.AddOrderCommandBase command)
 {
     throw new NotImplementedException();
 }
 public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.ParsePhysicalOrder((AddPhysicalDoneOrderCommand)command);
 }
 public override void VisitAddGeneralOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.ParseOrder((AddDoneOrderCommand)command);
 }
 public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.VisitCommon((Commands.AddMultipleClosePhysicalOrderCommand)command);
 }
 public abstract void VisitAddBOOrderCommand(Commands.AddOrderCommandBase command);
Beispiel #10
0
 public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.Visit((Commands.AddBookWithNoCalculationPhysicalOrderCommand)command);
 }
Beispiel #11
0
 public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.Visit((Commands.AddBookPhysicalOrderCommand)command);
 }
Beispiel #12
0
 public override void VisitAddGeneralOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.Visit((Commands.AddBookOrderCommand)command);
 }
 protected override void CreateOrderRelation(Order closeOrder, Commands.AddOrderCommandBase command)
 {
 }
 public override void VisitAddBOOrderCommand(Commands.AddOrderCommandBase command)
 {
     DataRowOrderParser.ParseForBO((BOOrderConstructParams)command.ConstructParams, ((Commands.AddDataRowBOOrderCommand)command).DataRow, command.Tran.InstrumentId, command.Tran.AccountId, null);
     this.CreateOrder(command);
 }
 public override void VisitAddBOOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.ParseCommon((AddCommunicationOrderCommandBase)command);
     this.CreateOrder(command);
 }
Beispiel #16
0
 public override void VisitAddPhysicalOrderCommand(Commands.AddOrderCommandBase command)
 {
     this.ParsePhysical((Commands.AddLmtQuantiryOnMaxLotChangeOrderCommandBase)command);
     this.CreateOrder(command);
 }