示例#1
0
        public override void onMessage(QuickFix43.NewOrderSingle order, SessionID sessionID)
        {
            Symbol   symbol   = new Symbol();
            Side     side     = new Side();
            OrdType  ordType  = new OrdType();
            OrderQty orderQty = new OrderQty();
            Price    price    = new Price();
            ClOrdID  clOrdID  = new ClOrdID();

            order.get(ordType);

            if (ordType.getValue() != OrdType.LIMIT)
            {
                throw new IncorrectTagValue(ordType.getField());
            }

            order.get(symbol);
            order.get(side);
            order.get(orderQty);
            order.get(price);
            order.get(clOrdID);

            QuickFix43.ExecutionReport executionReport = new QuickFix43.ExecutionReport
                                                             (genOrderID(),
                                                             genExecID(),
                                                             new ExecType(ExecType.FILL),
                                                             new OrdStatus(OrdStatus.FILLED),
                                                             side,
                                                             new LeavesQty(0),
                                                             new CumQty(orderQty.getValue()),
                                                             new AvgPx(price.getValue()));

            executionReport.set(clOrdID);
            executionReport.set(symbol);
            executionReport.set(orderQty);
            executionReport.set(new LastQty(orderQty.getValue()));
            executionReport.set(new LastPx(price.getValue()));

            if (order.isSetAccount())
            {
                executionReport.set(order.getAccount());
            }

            try
            {
                Session.sendToTarget(executionReport, sessionID);
            }
            catch (SessionNotFound) {}
        }
示例#2
0
 public sealed override void onMessage(QuickFix43.NewOrderSingle message, SessionID session)
 {
     Fix.Out(new StackTrace(new StackFrame(true)).GetFrame(0).GetMethod().ToString());
 }
 public override void onMessage(QuickFix43.NewOrderSingle message, SessionID sessionID)
 {
     process(message, sessionID);
 }
示例#4
0
		public virtual void Send(FIXNewOrderSingle Order)
		{
			QuickFix.FIX43.NewOrderSingle newOrderSingle = new QuickFix43.NewOrderSingle(new ClOrdID(Order.ClOrdID), new HandlInst(Order.HandlInst), new QuickFix.Side(Order.Side), new TransactTime(Order.TransactTime), new QuickFix.OrdType(Order.OrdType));
			if (Order.ContainsField(1))
				newOrderSingle.set(new Account(Order.Account));
			if (Order.ContainsField(18))
				newOrderSingle.set(new ExecInst(Order.ExecInst));
			if (Order.ContainsField(110))
				newOrderSingle.set(new MinQty(Order.MinQty));
			if (Order.ContainsField(111))
				newOrderSingle.set(new MaxFloor(Order.MaxFloor));
			if (Order.ContainsField(100))
				newOrderSingle.set(new ExDestination(Order.ExDestination));
			if (Order.ContainsField(81))
				newOrderSingle.set(new ProcessCode(Order.ProcessCode));
			if (Order.ContainsField(65))
				newOrderSingle.set(new SymbolSfx(Order.SymbolSfx));
			if (Order.ContainsField(48))
				newOrderSingle.set(new SecurityID(Order.SecurityID));
			if (Order.ContainsField(167))
				newOrderSingle.set(new QuickFix.SecurityType(Order.SecurityType));
			if (Order.ContainsField(200))
				newOrderSingle.set(new MaturityMonthYear(Order.MaturityMonthYear));
			if (Order.ContainsField(202))
				newOrderSingle.set(new StrikePrice(Order.StrikePrice));
			if (Order.ContainsField(206))
				newOrderSingle.set(new OptAttribute(Order.OptAttribute));
			if (Order.ContainsField(231))
				newOrderSingle.set(new ContractMultiplier(Order.ContractMultiplier));
			if (Order.ContainsField(223))
				newOrderSingle.set(new CouponRate(Order.CouponRate));
			if (Order.ContainsField(207))
				newOrderSingle.set(new SecurityExchange(Order.SecurityExchange));
			if (Order.ContainsField(106))
				newOrderSingle.set(new Issuer(Order.Issuer));
			if (Order.ContainsField(348))
				newOrderSingle.set(new EncodedIssuerLen(Order.EncodedIssuerLen));
			if (Order.ContainsField(349))
				newOrderSingle.set(new EncodedIssuer(Order.EncodedIssuer));
			if (Order.ContainsField(107))
				newOrderSingle.set(new SecurityDesc(Order.SecurityDesc));
			if (Order.ContainsField(350))
				newOrderSingle.set(new EncodedSecurityDescLen(Order.EncodedSecurityDescLen));
			if (Order.ContainsField(351))
				newOrderSingle.set(new EncodedSecurityDesc(Order.EncodedSecurityDesc));
			if (Order.ContainsField(140))
				newOrderSingle.set(new PrevClosePx(Order.PrevClosePx));
			if (Order.ContainsField(38))
				newOrderSingle.set(new OrderQty(Order.OrderQty));
			if (Order.ContainsField(152))
				newOrderSingle.set(new CashOrderQty(Order.CashOrderQty));
			if (Order.ContainsField(44))
				newOrderSingle.set(new Price(Order.Price));
			if (Order.ContainsField(99))
				newOrderSingle.set(new StopPx(Order.StopPx));
			if (Order.ContainsField(15))
				newOrderSingle.set(new QuickFix.Currency(Order.Currency));
			if (Order.ContainsField(376))
				newOrderSingle.set(new ComplianceID(Order.ComplianceID));
			if (Order.ContainsField(117))
				newOrderSingle.set(new QuoteID(Order.QuoteID));
			if (Order.ContainsField(59))
				newOrderSingle.set(new QuickFix.TimeInForce(Order.TimeInForce));
			if (Order.ContainsField(168))
				newOrderSingle.set(new EffectiveTime(Order.EffectiveTime));
			if (Order.ContainsField(126))
				newOrderSingle.set(new ExpireTime(Order.ExpireTime));
			if (Order.ContainsField(427))
				newOrderSingle.set(new GTBookingInst(Order.GTBookingInst));
			if (Order.ContainsField(12))
				newOrderSingle.set(new Commission(Order.Commission));
			if (Order.ContainsField(13))
				newOrderSingle.set(new QuickFix.CommType(Order.CommType));
			if (Order.ContainsField(120))
				newOrderSingle.set(new SettlCurrency(Order.SettlCurrency));
			if (Order.ContainsField(58))
				newOrderSingle.set(new Text(Order.Text));
			if (Order.ContainsField(354))
				newOrderSingle.set(new EncodedTextLen(Order.EncodedTextLen));
			if (Order.ContainsField(355))
				newOrderSingle.set(new EncodedText(Order.EncodedText));
			if (Order.ContainsField(192))
				newOrderSingle.set(new OrderQty2(Order.OrderQty2));
			if (Order.ContainsField(203))
				newOrderSingle.set(new CoveredOrUncovered(Order.CoveredOrUncovered));
			if (Order.ContainsField(210))
				newOrderSingle.set(new MaxShow(Order.MaxShow));
			if (Order.ContainsField(388))
				newOrderSingle.set(new DiscretionInst(Order.DiscretionInst));
			try
			{
				Session.sendToTarget((QuickFix.Message)newOrderSingle, this.fSessionID);
			}
			catch (Exception ex)
			{
				Console.WriteLine(BeAEwTZGlZaeOmY5cm.J00weU3cM6(478) + ex.Message);
			}
		}