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);
}
}
Aggregations