@Override default boolean accept(LimitOrder order) { return order != null && getCurrencyPairs() != null && getCurrencyPairs().contains(order.getCurrencyPair()); }
public void verifyOrder(LimitOrder limitOrder) { ExchangeMetaData exchangeMetaData = exchange.getExchangeMetaData(); verifyOrder(limitOrder, exchangeMetaData); BigDecimal price = limitOrder.getLimitPrice().stripTrailingZeros(); if (price.scale() > exchangeMetaData.getCurrencyPairs().get(limitOrder.getCurrencyPair()).getPriceScale()) { throw new IllegalArgumentException("Unsupported price scale " + price.scale()); } }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { String symbol = limitOrder.getCurrencyPair().base.getCurrencyCode().toLowerCase() + limitOrder.getCurrencyPair().counter.getCurrencyCode().toLowerCase(); FCoinSide side = getSide(limitOrder.getType()); return placeLimitOrder( symbol, limitOrder.getOriginalAmount(), limitOrder.getLimitPrice(), side); } }
public CoinoneTradeCancelRequest(String orderId, LimitOrder limitOrder) { this.orderId = orderId; this.price = limitOrder.getLimitPrice(); this.qty = limitOrder.getOriginalAmount(); this.isAsk = limitOrder.getType() == Order.OrderType.ASK ? true : false; this.currency = limitOrder.getCurrencyPair().base.getSymbol().toLowerCase(); }
@Override default boolean accept(LimitOrder order) { return order != null && getCurrencyPair() != null && getCurrencyPair().equals(order.getCurrencyPair()); }
@Override public String placeLimitOrder(LimitOrder order) throws IOException { CoinfloorOrder rawOrder = placeLimitOrder( order.getCurrencyPair(), order.getType(), order.getOriginalAmount(), order.getLimitPrice()); return Long.toString(rawOrder.getId()); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { return independentReservePlaceLimitOrder( limitOrder.getCurrencyPair(), limitOrder.getType(), limitOrder.getLimitPrice(), limitOrder.getOriginalAmount()); }
@Override public String placeLimitOrder(LimitOrder order) throws IOException, BTCMarketsException { return placeOrder( order.getCurrencyPair(), order.getType(), order.getOriginalAmount(), order.getLimitPrice(), BTCMarketsOrder.Type.Limit); }
@Override public String placeLimitOrder(LimitOrder order) throws IOException, ExchangeException { final TheRockOrder placedOrder = placeTheRockOrder( order.getCurrencyPair(), order.getOriginalAmount(), order.getLimitPrice(), TheRockAdapters.adaptSide(order.getType()), TheRockOrder.Type.limit); return placedOrder.getId().toString(); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { BigDecimal amount = limitOrder.getOriginalAmount(); BigDecimal price = limitOrder.getAveragePrice(); String type = limitOrder.getType() == OrderType.ASK ? "buy" : "sell"; String coin = limitOrder.getCurrencyPair().base.getCurrencyCode().toLowerCase(); return CoinEggAdapters.adaptTradeAdd(getCoinEggTradeAdd(amount, price, type, coin)); }
public UpbitOrderResponse limitOrder(LimitOrder limitOrder) throws IOException { UpbitOrderRequest upbitOrderRequest = new UpbitOrderRequest(); String marketId = limitOrder.getCurrencyPair().counter + "-" + limitOrder.getCurrencyPair().base; upbitOrderRequest.setMarketId(marketId); upbitOrderRequest.setOrderType(limitOrder.getType().name().toLowerCase()); upbitOrderRequest.setVolume(limitOrder.getOriginalAmount().toString()); upbitOrderRequest.setPrice(limitOrder.getLimitPrice().toString()); upbitOrderRequest.setSide(limitOrder.getType().equals(Order.OrderType.ASK) ? "ask" : "bid"); upbitOrderRequest.setOrderType("limit"); return upbit.limitOrder(this.signatureCreator, upbitOrderRequest); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { WexOrder.Type type = limitOrder.getType() == Order.OrderType.BID ? WexOrder.Type.buy : WexOrder.Type.sell; String pair = WexAdapters.getPair(limitOrder.getCurrencyPair()); WexOrder wexOrder = new WexOrder( 0, null, limitOrder.getLimitPrice(), limitOrder.getOriginalAmount(), type, pair); WexPlaceOrderResult result = placeBTCEOrder(wexOrder); return Long.toString(result.getOrderId()); }
protected CobinhoodResponse<CobinhoodOrder.Container> placeCobinhoodLimitOrder(LimitOrder order) throws IOException { CobinhoodPlaceOrderRequest request = new CobinhoodPlaceOrderRequest( CobinhoodAdapters.adaptCurrencyPair(order.getCurrencyPair()), CobinhoodOrderSide.fromOrderType(order.getType()).name(), CobinhoodOrderType.limit, order.getLimitPrice().toString(), order.getOriginalAmount().toString()); return cobinhood.placeOrder(apiKey, exchange.getNonceFactory(), request); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { QuoineOrderResponse quoinePlaceOrderResponse = placeLimitOrder( limitOrder.getCurrencyPair(), limitOrder.getType() == OrderType.ASK ? "sell" : "buy", limitOrder.getOriginalAmount(), limitOrder.getLimitPrice()); return quoinePlaceOrderResponse.getId(); }
private static LimitOrder withAmount(LimitOrder limitOrder, BigDecimal tradeableAmount) { OrderType type = limitOrder.getType(); CurrencyPair currencyPair = limitOrder.getCurrencyPair(); String id = limitOrder.getId(); Date date = limitOrder.getTimestamp(); BigDecimal limit = limitOrder.getLimitPrice(); return new LimitOrder(type, tradeableAmount, currencyPair, id, date, limit); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { try { return submitTrade( limitOrder.getCurrencyPair(), limitOrder.getType(), limitOrder.getLimitPrice(), limitOrder.getOriginalAmount()); } catch (CryptopiaException e) { throw CryptopiaErrorAdapter.adapt(e); } }
@Override public String placeLimitOrder(LimitOrder arg0) throws IOException { VaultoroNewOrderResponse response = super.placeLimitOrder( arg0.getCurrencyPair(), arg0.getType(), arg0.getOriginalAmount(), arg0.getLimitPrice()); return response.getData().getOrderID(); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { LunoPostOrder postLimitOrder = lunoAPI.postLimitOrder( LunoUtil.toLunoPair(limitOrder.getCurrencyPair()), convertForLimit(limitOrder.getType()), limitOrder.getOriginalAmount(), limitOrder.getLimitPrice(), null, null); return postLimitOrder.orderId; }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { return super.placeLimitOrder( limitOrder.getOriginalAmount(), limitOrder.getLimitPrice(), limitOrder.getCurrencyPair(), BTCTurkAdapters.adaptOrderType(limitOrder.getType())) .getId(); }
@Override public String placeLimitOrder(LimitOrder limitOrder) throws IOException { String side = limitOrder.getType() == Order.OrderType.BID ? "Buy" : "Sell"; DVChainNewLimitOrder dvChainNewLimitOrder = new DVChainNewLimitOrder( side, limitOrder.getLimitPrice(), limitOrder.getOriginalAmount(), limitOrder.getCurrencyPair().base.getSymbol()); return newDVChainLimitOrder(dvChainNewLimitOrder).toString(); }