use of org.knowm.xchange.quoine.dto.trade.QuoineNewMarginOrderRequest in project XChange by knowm.
the class QuoineTradeServiceRaw method placeLimitOrder.
public QuoineOrderResponse placeLimitOrder(CurrencyPair currencyPair, String type, BigDecimal originalAmount, BigDecimal price) throws IOException {
int productId = productId(currencyPair);
QuoineNewOrderRequest quoineNewOrderRequest = useMargin ? new QuoineNewMarginOrderRequest("limit", productId, type, originalAmount, price, leverageLevel, currencyPair.counter.getCurrencyCode()) : new QuoineNewOrderRequest("limit", productId, type, originalAmount, price);
try {
return quoine.placeOrder(QUOINE_API_VERSION, signatureCreator, contentType, new QuoineNewOrderRequestWrapper(quoineNewOrderRequest));
} catch (HttpStatusIOException e) {
throw handleHttpError(e);
}
}
use of org.knowm.xchange.quoine.dto.trade.QuoineNewMarginOrderRequest in project XChange by knowm.
the class QuoineTradeServiceRaw method placeMarketOrder.
public QuoineOrderResponse placeMarketOrder(CurrencyPair currencyPair, String type, BigDecimal originalAmount) throws IOException {
int productId = productId(currencyPair);
QuoineNewOrderRequest quoineNewOrderRequest = useMargin ? new QuoineNewMarginOrderRequest("market", productId, type, originalAmount, null, leverageLevel, currencyPair.counter.getCurrencyCode()) : new QuoineNewOrderRequest("market", productId, type, originalAmount, null);
try {
return quoine.placeOrder(QUOINE_API_VERSION, signatureCreator, contentType, new QuoineNewOrderRequestWrapper(quoineNewOrderRequest));
} catch (HttpStatusIOException e) {
throw handleHttpError(e);
}
}
Aggregations