knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.81k stars 1.93k forks source link

[CEXIO] placeMarketOrder function #2562

Open mike789vvv opened 6 years ago

mike789vvv commented 6 years ago

Hello, Current implementation placeMarketOrder return NotAvailableFromExchangeException() On documentation https://cex.io/rest-api#/definitions/PlaceOrderRequest For place market order need set up param order_type = "market"

For example: org.knowm.xchange.cexio.dto.PlaceOrderRequest

public class PlaceOrderRequest extends CexIORequest { public final CexIOOrder.Type type; public final BigDecimal price; public final BigDecimal amount; public String order_type = "limit";

public PlaceOrderRequest(CexIOOrder.Type type, BigDecimal price, BigDecimal amount) { this.type = type; this.price = price; this.amount = amount; if (price == null){ this.order_type = "market"; } } }

timmolter commented 6 years ago

If it's not implemented in XChange, you'll probably have to do it yourself. I PR with the change would be appreciated.

mike789vvv commented 6 years ago

I have already done and use the local copy of the module. Minor changes were made to several files that I attach to the message.

org.knowm.xchange.cexio.service.CexIOTradeService - added placeMarketOrder org.knowm.xchange.cexio.service.CexIOTradeServiceRaw - added placeCexIOMarketOrder org.knowm.xchange.cexio.dto.PlaceOrderRequest - added param "order_type"

cexio_placemarketorder.zip

amjad1210 commented 6 years ago

@mike789vvv take a look a this guide on how to fork a project.

https://help.github.com/articles/fork-a-repo/