Search in sources :

Example 1 with QuoineNewMarginOrderRequest

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);
    }
}
Also used : QuoineNewMarginOrderRequest(org.knowm.xchange.quoine.dto.trade.QuoineNewMarginOrderRequest) QuoineNewOrderRequestWrapper(org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequestWrapper) QuoineNewOrderRequest(org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequest) HttpStatusIOException(si.mazi.rescu.HttpStatusIOException)

Example 2 with QuoineNewMarginOrderRequest

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);
    }
}
Also used : QuoineNewMarginOrderRequest(org.knowm.xchange.quoine.dto.trade.QuoineNewMarginOrderRequest) QuoineNewOrderRequestWrapper(org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequestWrapper) QuoineNewOrderRequest(org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequest) HttpStatusIOException(si.mazi.rescu.HttpStatusIOException)

Aggregations

QuoineNewMarginOrderRequest (org.knowm.xchange.quoine.dto.trade.QuoineNewMarginOrderRequest)2 QuoineNewOrderRequest (org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequest)2 QuoineNewOrderRequestWrapper (org.knowm.xchange.quoine.dto.trade.QuoineNewOrderRequestWrapper)2 HttpStatusIOException (si.mazi.rescu.HttpStatusIOException)2