public void OnMessage(QuickFix.FIX50.NewOrderSingle n, SessionID s) { Symbol symbol = n.Symbol; Side side = n.Side; OrdType ordType = n.OrdType; OrderQty orderQty = n.OrderQty; Price price = new Price(DEFAULT_MARKET_PRICE); ClOrdID clOrdID = n.ClOrdID; switch (ordType.getValue()) { case OrdType.LIMIT: price = n.Price; if (price.Obj == 0) { throw new IncorrectTagValue(price.Tag); } break; case OrdType.MARKET: break; default: throw new IncorrectTagValue(ordType.Tag); } QuickFix.FIX50.ExecutionReport exReport = new QuickFix.FIX50.ExecutionReport( new OrderID(GenOrderID()), new ExecID(GenExecID()), new ExecType(ExecType.FILL), new OrdStatus(OrdStatus.FILLED), side, new LeavesQty(0), new CumQty(orderQty.getValue())); exReport.Set(clOrdID); exReport.Set(symbol); exReport.Set(orderQty); exReport.Set(new LastQty(orderQty.getValue())); exReport.Set(new LastPx(price.getValue())); exReport.Set(new AvgPx(price.getValue())); if (n.IsSetAccount()) { exReport.SetField(n.Account); } try { Session.SendToTarget(exReport, s); } catch (SessionNotFound ex) { Console.WriteLine("==session not found exception!=="); Console.WriteLine(ex.ToString()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
private void OmsFixClient_OnExecutionReport(object sender, QuickFix.FIX50.ExecutionReport e) { Console.WriteLine("EXECUTION REPORT " + e); }
public void OnMessage(QuickFix.FIX50.ExecutionReport n, SessionID s) { OnExecutionReport?.Invoke(this, n); }
public void OnMessage(QuickFix.FIX50.NewOrderSingle n, SessionID s) { Symbol symbol = n.Symbol; Side side = n.Side; OrdType ordType = n.OrdType; OrderQty orderQty = n.OrderQty; Price price = new Price(DEFAULT_MARKET_PRICE); ClOrdID clOrdID = n.ClOrdID; switch (ordType.getValue()) { case OrdType.LIMIT: price = n.Price; if (price.Obj == 0) throw new IncorrectTagValue(price.Tag); break; case OrdType.MARKET: break; default: throw new IncorrectTagValue(ordType.Tag); } QuickFix.FIX50.ExecutionReport exReport = new QuickFix.FIX50.ExecutionReport( new OrderID(GenOrderID()), new ExecID(GenExecID()), new ExecType(ExecType.FILL), new OrdStatus(OrdStatus.FILLED), side, new LeavesQty(0), new CumQty(orderQty.getValue())); exReport.Set(clOrdID); exReport.Set(symbol); exReport.Set(orderQty); exReport.Set(new LastQty(orderQty.getValue())); exReport.Set(new LastPx(price.getValue())); exReport.Set(new AvgPx(price.getValue())); if (n.IsSetAccount()) exReport.SetField(n.Account); try { Session.SendToTarget(exReport, s); } catch (SessionNotFound ex) { Console.WriteLine("==session not found exception!=="); Console.WriteLine(ex.ToString()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void OnMessage(QuickFix.FIX50.ExecutionReport m, SessionID s) { Console.WriteLine("Received execution report"); }
public void OnMessage(QuickFix.FIX50.NewOrderSingle n, SessionID s) { Symbol symbol = n.Symbol; Side side = n.Side; OrdType ordType = n.OrdType; OrderQty orderQty = n.OrderQty; Price price = n.Price; ClOrdID clOrdID = n.ClOrdID; if (ordType.getValue() != OrdType.LIMIT) throw new IncorrectTagValue(ordType.Tag); QuickFix.FIX50.ExecutionReport exReport = new QuickFix.FIX50.ExecutionReport( new OrderID(GenOrderID()), new ExecID(GenExecID()), new ExecType(ExecType.FILL), new OrdStatus(OrdStatus.FILLED), side, new LeavesQty(0), new CumQty(orderQty.getValue())); exReport.Set(clOrdID); exReport.Set(symbol); exReport.Set(orderQty); exReport.Set(new LastQty(orderQty.getValue())); exReport.Set(new LastPx(price.getValue())); exReport.Set(new AvgPx(price.getValue())); if (n.IsSetAccount()) exReport.SetField(n.Account); try { Session.SendToTarget(exReport, s); } catch (SessionNotFound ex) { Console.WriteLine("==session not found exception!=="); Console.WriteLine(ex.Message); } catch (Exception ex) { Console.WriteLine("==unknown exception=="); Console.WriteLine(ex.ToString()); Console.WriteLine(ex.StackTrace); } }