public boolean isSetExecBroker() { return isSetField(76); }
public quickfix.field.ClOrdID get(quickfix.field.ClOrdID value) throws FieldNotFound { getField(value); return value; }
public NewOrderSingle(quickfix.field.ClOrdID clOrdID, quickfix.field.HandlInst handlInst, quickfix.field.Symbol symbol, quickfix.field.Side side, quickfix.field.TransactTime transactTime, quickfix.field.OrdType ordType) { this(); setField(clOrdID); setField(handlInst); setField(symbol); setField(side); setField(transactTime); setField(ordType); }
public void onMessage(NewOrderSingle message, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue { String senderCompId = message.getHeader().getString(SenderCompID.FIELD); String targetCompId = message.getHeader().getString(TargetCompID.FIELD); String clOrdId = message.getString(ClOrdID.FIELD); String symbol = message.getString(Symbol.FIELD); char side = message.getChar(Side.FIELD); char ordType = message.getChar(OrdType.FIELD); double price = 0; if (ordType == OrdType.LIMIT) { price = message.getDouble(Price.FIELD); } double qty = message.getDouble(OrderQty.FIELD); char timeInForce = TimeInForce.DAY; if (message.isSetField(TimeInForce.FIELD)) { timeInForce = message.getChar(TimeInForce.FIELD); } try { if (timeInForce != TimeInForce.DAY) { throw new RuntimeException("Unsupported TIF, use Day"); } Order order = new Order(clOrdId, symbol, senderCompId, targetCompId, side, ordType, price, (int) qty); processOrder(order); } catch (Exception e) { rejectOrder(targetCompId, senderCompId, clOrdId, symbol, side, e.getMessage()); } }
public quickfix.field.FutSettDate getFutSettDate() throws FieldNotFound { return get(new quickfix.field.FutSettDate()); }
private NewOrderSingle build() { final NewOrderSingle order = new NewOrderSingle( new ClOrdID(UUID.randomUUID().toString()), new HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PUBLIC), new Symbol(symbol), new Side(side), new TransactTime(new Date()), new OrdType(orderType)); order.set(new OrderQty(quantity)); order.set(new Price(price)); return order; } }
public NewOrderSingle() { super(); getHeader().setField(new quickfix.field.MsgType(MSGTYPE)); }
private OrderEntry convertToOrderEntry(NewOrderSingle orderSingle, String broker) throws FieldNotFound { OrderSide side = orderSingle.getSide().getValue() == Side.BUY ? OrderSide.Buy : OrderSide.Sell; OrderType orderType = null; switch (orderSingle.getOrdType().getValue()) { case OrdType.MARKET: orderType = new Market(); break; case OrdType.LIMIT: orderType = new Limit(orderSingle.getPrice().getValue()); break; } return new OrderEntry( side, broker, (int) orderSingle.getOrderQty().getValue(), orderType); }
public void onMessage(quickfix.fix42.NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue { try { validateOrder(order); OrderQty orderQty = order.getOrderQty(); Price price = getPrice(order); quickfix.fix42.ExecutionReport accept = new quickfix.fix42.ExecutionReport(genOrderID(), genExecID(), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.FILL), new OrdStatus(OrdStatus.NEW), order .getSymbol(), order.getSide(), new LeavesQty(0), new CumQty(0), new AvgPx(0)); accept.set(order.getClOrdID()); sendMessage(sessionID, accept); if (isOrderExecutable(order, price)) { quickfix.fix42.ExecutionReport executionReport = new quickfix.fix42.ExecutionReport(genOrderID(), genExecID(), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.FILL), new OrdStatus( OrdStatus.FILLED), order.getSymbol(), order.getSide(), new LeavesQty(0), new CumQty( orderQty.getValue()), new AvgPx(price.getValue())); executionReport.set(order.getClOrdID()); executionReport.set(orderQty); executionReport.set(new LastShares(orderQty.getValue())); executionReport.set(new LastPx(price.getValue())); sendMessage(sessionID, executionReport); } } catch (RuntimeException e) { LogUtil.logThrowable(sessionID, e.getMessage(), e); } }
@Override public void onMessage(NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue { final String broker = sessionID.getTargetCompID(); OrderEntry orderEntry = convertToOrderEntry(order, broker); acceptOrder(orderEntry); final String symbol = order.getSymbol().getValue(); orderPublisher.publish(symbol, orderEntry, OrderEntry.class); // TODO: this is going away soon when subscribe is ready on the matching engine side matchingUnit.addOrder(orderEntry); }
public quickfix.field.SymbolSfx getSymbolSfx() throws FieldNotFound { return get(new quickfix.field.SymbolSfx()); }
public void send42(Order order) { quickfix.fix42.NewOrderSingle newOrderSingle = new quickfix.fix42.NewOrderSingle( new ClOrdID(order.getID()), new HandlInst('1'), new Symbol(order.getSymbol()), sideToFIXSide(order.getSide()), new TransactTime(), typeToFIXType(order.getType())); newOrderSingle.set(new OrderQty(order.getQuantity())); send(populateOrder(order, newOrderSingle), order.getSessionID()); }
public NewOrderSingle() { super(); getHeader().setField(new quickfix.field.MsgType(MSGTYPE)); }
public boolean isSetSettlmntTyp() { return isSetField(63); }
public quickfix.field.HandlInst get(quickfix.field.HandlInst value) throws FieldNotFound { getField(value); return value; }
public NewOrderSingle(quickfix.field.ClOrdID clOrdID, quickfix.field.HandlInst handlInst, quickfix.field.Symbol symbol, quickfix.field.Side side, quickfix.field.TransactTime transactTime, quickfix.field.OrdType ordType) { this(); setField(clOrdID); setField(handlInst); setField(symbol); setField(side); setField(transactTime); setField(ordType); }
public quickfix.field.SecurityID getSecurityID() throws FieldNotFound { return get(new quickfix.field.SecurityID()); }