use of org.knowm.xchange.binance.dto.trade.OrderType in project XChange by knowm.
the class BinanceTradeService method placeStopOrder.
@Override
public String placeStopOrder(StopOrder order) throws IOException {
// Time-in-force should not be provided for market orders but is required for
// limit orders, order we only default it for limit orders. If the caller
// specifies one for a market order, we don't remove it, since Binance might
// allow
// it at some point.
TimeInForce tif = timeInForceFromOrder(order).orElse(order.getLimitPrice() != null ? TimeInForce.GTC : null);
OrderType orderType = BinanceAdapters.adaptOrderType(order);
return placeOrder(orderType, order, order.getLimitPrice(), order.getStopPrice(), tif);
}
use of org.knowm.xchange.binance.dto.trade.OrderType in project XChange by knowm.
the class BinanceTradeService method placeLimitOrder.
@Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
TimeInForce tif = timeInForceFromOrder(limitOrder).orElse(TimeInForce.GTC);
OrderType type;
if (limitOrder.hasFlag(org.knowm.xchange.binance.dto.trade.BinanceOrderFlags.LIMIT_MAKER)) {
type = OrderType.LIMIT_MAKER;
tif = null;
} else {
type = OrderType.LIMIT;
}
return placeOrder(type, limitOrder, limitOrder.getLimitPrice(), null, tif);
}
Aggregations