Search in sources :

Example 1 with BinanceNewOrder

use of org.knowm.xchange.binance.dto.trade.BinanceNewOrder in project XChange by knowm.

the class BinanceTradeService method placeOrder.

private String placeOrder(OrderType type, Order order, BigDecimal limitPrice, BigDecimal stopPrice, TimeInForce tif) throws IOException {
    try {
        Long recvWindow = (Long) exchange.getExchangeSpecification().getExchangeSpecificParametersItem("recvWindow");
        BinanceNewOrder newOrder = newOrder(order.getCurrencyPair(), BinanceAdapters.convert(order.getType()), type, tif, order.getOriginalAmount(), limitPrice, getClientOrderId(order), stopPrice, null, null);
        return Long.toString(newOrder.orderId);
    } catch (BinanceException e) {
        throw BinanceErrorAdapter.adapt(e);
    }
}
Also used : BinanceException(org.knowm.xchange.binance.dto.BinanceException) BinanceNewOrder(org.knowm.xchange.binance.dto.trade.BinanceNewOrder)

Aggregations

BinanceException (org.knowm.xchange.binance.dto.BinanceException)1 BinanceNewOrder (org.knowm.xchange.binance.dto.trade.BinanceNewOrder)1