internal PhysicalOrder(Transaction owner, PhysicalOrderConstructParams constructParams, OrderServiceFactoryBase factory) : base(owner, constructParams, factory) { _physicalSettings = (PhysicalOrderSettings)_orderSettings; _instalment = _physicalSettings.Instalment; _instalmentDetailManager = new InstalmentDetailManager(this, _instalment); }
internal static void ParseForPhysical(PhysicalOrderConstructParams constructParams, IDBRow dataRowOrder, Guid instrumentId, Guid accountId, DateTime?tradeDay) { DataRowOrderParser.ParseForGeneral(constructParams, dataRowOrder, instrumentId, accountId, tradeDay); constructParams.PhysicalSettings = DataRowOrderParser.ParsePhysicalSettings(dataRowOrder); if (constructParams.PhysicalSettings.PhysicalType != Protocal.Physical.PhysicalType.FullPayment) { Logger.InfoFormat("ParseForPhysical orderId={0}", constructParams.Id); constructParams.Instalment = DataRowOrderParser.ParseInstalment(dataRowOrder); } }
private void ParsePhysicalOrder(AddPhysicalDoneOrderCommand command) { PhysicalOrderConstructParams physicalOrderConstructParams = (PhysicalOrderConstructParams)command.ConstructParams; physicalOrderConstructParams.PhysicalSettings = new PhysicalConstructParams() { PhysicalTradeSide = PhysicalTradeSide.None }; this.ParseCommon(physicalOrderConstructParams, command); this.CreateOrder(command); }
private void ParseCommon(AddInstalmentOrderOrderCommand command) { var lotBalance = command.IsOpen ? command.Lot : 0; PhysicalOrderConstructParams constructParams = (PhysicalOrderConstructParams)command.ConstructParams; constructParams.Id = Guid.NewGuid(); constructParams.Phase = OrderPhase.Placed; constructParams.IsOpen = command.IsOpen; constructParams.IsBuy = command.IsBuy; constructParams.SetPrice = command.OldOrder.SetPrice; constructParams.SetPrice2 = command.OldOrder.SetPrice2; constructParams.ExecutePrice = command.OldOrder.ExecutePrice; constructParams.Lot = command.Lot; constructParams.OriginalLot = command.Lot; constructParams.LotBalance = lotBalance; constructParams.TradeOption = command.OldOrder.TradeOption; constructParams.PhysicalSettings = new PhysicalConstructParams { PhysicalTradeSide = command.OldOrder.PhysicalTradeSide, PhysicalType = command.OldOrder.PhysicalType }; constructParams.Instalment = this.CreateInstalmentConstructParams(command.OldOrder); }