/** * Constructor * * @param nonce */ public CoinoneTradeRequest( String accessTocken, Long nonce, BigDecimal price, BigDecimal qty, Currency currency) { this.accessTocken = accessTocken; this.nonce = nonce; this.price = price; this.qty = qty; this.currency = currency.getSymbol().toLowerCase(); }
public static String toSymbol(Currency currency) { if (Currency.IOT.equals(currency)) { return "IOTA"; } return currency.getSymbol(); }
/** * @param currency * @return */ public static String toSymbol(Currency currency) { if (Currency.IOT.equals(currency)) { return "IOTA"; } return currency.getSymbol(); }
/** * @param currency * @return */ public static String toSymbol(Currency currency) { if (Currency.IOT.equals(currency)) { return "IOTA"; } return currency.getSymbol(); }
public CoinoneTrades getTrades(CurrencyPair currencyPair, String period) throws IOException { return coinone.getTrades(currencyPair.base.getSymbol(), period); } }
public CoinoneTicker getTicker(CurrencyPair currencyPair) throws IOException { return coinone.getTicker(currencyPair.base.getSymbol()); }
public CoinoneOrderBook getCoinoneOrderBook(CurrencyPair currencyPair) throws IOException { return coinone.getOrderBook(currencyPair.base.getSymbol()); }
public MercadoBitcoinTicker getMercadoBitcoinTicker(CurrencyPair currencyPair) throws IOException { MercadoBitcoinUtils.verifyCurrencyPairAvailability(currencyPair); return mercadoBitcoin.getTicker(currencyPair.base.getSymbol()); }
public MercadoBitcoinOrderBook getMercadoBitcoinOrderBook(CurrencyPair currencyPair) throws IOException { MercadoBitcoinUtils.verifyCurrencyPairAvailability(currencyPair); return mercadoBitcoin.getOrderBook(currencyPair.base.getSymbol()); }
public CexioClosePosition closePosition(CurrencyPair currencyPair, String id) throws IOException { CexioClosePositionResponse response = cexIOAuthenticated.closePosition( signatureCreator, currencyPair.base.getSymbol(), currencyPair.counter.getSymbol(), new CexIOGetPositionRequest(id)); if (!"ok".equalsIgnoreCase(response.getStatus())) { throw new ExchangeException(response.getEventName() + " " + response.getStatus()); } return response.getPosition(); }
public List<CexioPosition> getOpenPositions(CurrencyPair currencyPair) throws IOException { CexioOpenPositionsResponse response = cexIOAuthenticated.getOpenPositions( signatureCreator, currencyPair.base.getSymbol(), currencyPair.counter.getSymbol(), new CexIORequest()); if (!"ok".equalsIgnoreCase(response.getStatus())) { throw new ExchangeException(response.getEventName() + " " + response.getStatus()); } return response.getPositions(); }
@Override public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException, RateLimitExceededException { DVChainMarketResponse marketResponse = getMarketData(); DVChainMarketData marketData = marketResponse.getMarketData().get(currencyPair.base.getSymbol()); return DVChainAdapters.adaptOrderBook(marketData, marketData.getExpiresAt(), currencyPair); } }
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(); }
public CoinoneOrderInfoResponse getOrderInfo(String orderId, CurrencyPair currencyPair) throws CoinoneException, IOException { CoinoneOrderInfoRequest request = new CoinoneOrderInfoRequest( apiKey, exchange.getNonceFactory().createValue(), orderId, currencyPair.base.getSymbol().toLowerCase()); return coinone.getOrder(payloadCreator, signatureCreator, request); } }
public CoinoneWithdrawResponse withdrawFund( Currency currency, BigDecimal amount, String address, String authNumber) throws CoinoneException, IOException { CoinoneWithdrawRequest request = new CoinoneWithdrawRequest( apiKey, exchange.getNonceFactory().createValue(), currency.getSymbol().toLowerCase(), authNumber, amount.doubleValue(), address); CoinoneWithdrawResponse response = coinone.withdrawFund(payloadCreator, signatureCreator, request); return response; } }
@Override public String placeMarketOrder(MarketOrder marketOrder) throws IOException { DVChainMarketResponse marketResponse = marketDataService.getMarketData(); DVChainMarketData marketData = marketResponse.getMarketData().get(marketOrder.getCurrencyPair().base.getSymbol()); List<DVChainLevel> levels = marketData.getLevels(); String side = marketOrder.getType() == Order.OrderType.BID ? "Buy" : "Sell"; DVChainNewMarketOrder dvChainNewMarketOrder = new DVChainNewMarketOrder( side, getPriceForMarketOrder(levels, marketOrder), marketOrder.getOriginalAmount(), marketOrder.getCurrencyPair().base.getSymbol()); return newDVChainMarketOrder(dvChainNewMarketOrder).toString(); }
@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(); }
private BitcointoyouOrderResponse createOrder(String action, LimitOrder limitOrder) throws IOException { try { String asset = limitOrder.getCurrencyPair().base.getSymbol(); return bitcointoyouAuthenticated.createOrder( apiKey, exchange.getNonceFactory(), signatureCreator, asset, action, limitOrder.getOriginalAmount(), limitOrder.getLimitPrice()); } catch (BitcointoyouException e) { throw new ExchangeException(e.getError()); } }