Package quickfix.fix42

Examples of quickfix.fix42.NewOrderSingle


    @Override
    public String generateNewOrderSingleMessage(Order order) {

        logger.debug("Generating NewOrderSingle: {}", order);

        NewOrderSingle fixMessage = new NewOrderSingle(
                ClOrdIDConverter.toFix(getBrokerId(), order.getId()),
                OrderSideConverter.toFix(order.getSide()),
                new TransactTime(order.getCreationTime().toDate()),
                OrderTypeConverter.toFix(order.getType()));

        fixMessage.set(InstrumentConverter.toFix(order.getSymbol()));
        fixMessage.set(OrderQuantityConverter.toFix(order.getQuantity()));
        if (order.getLimitPrice() != null) {
            fixMessage.set(MoneyConverter.toFixPrice(order.getLimitPrice()));
            fixMessage.set(MoneyConverter.toFixCurrency(order.getLimitPrice()));
        }
        fixMessage.set(OrderTermConverter.toFix(order.getTerm()));
        if (order.isAllOrNone()) {
            fixMessage.set(new ExecInst(Character.toString(ExecInst.ALL_OR_NONE)));
        }
       
        logger.debug("Sending message:\n{}", FixFormatter.format(fixMessage));
        return fixMessage.toString();
    }
View Full Code Here

TOP

Related Classes of quickfix.fix42.NewOrderSingle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.