private static void generic(Exchange bitfinex) { System.out.println(bitfinex.getExchangeSymbols().toString()); }
public static List<CurrencyPair> getPairs(OpenOrdersParams params, Exchange exchange) { List<CurrencyPair> pairs = new ArrayList<>(); if (params instanceof OpenOrdersParamCurrencyPair) { final CurrencyPair paramsCp = ((OpenOrdersParamCurrencyPair) params).getCurrencyPair(); if (paramsCp != null) { pairs.add(paramsCp); } } if (pairs.isEmpty()) { pairs = exchange.getExchangeSymbols(); } return pairs; }
public List<OrderBook> getAllOrderBooks(Integer depth) { return getOrderBooks(depth, exchange.getExchangeSymbols()); }
@Override public Collection<Order> getOrder(String... orderIds) throws IOException { List<OkCoinFuturesOrderQueryParams> params = new ArrayList<OkCoinFuturesOrderQueryParams>(); for (CurrencyPair symbol : exchange.getExchangeSymbols()) { for (String orderId : orderIds) { params.add(new OkCoinFuturesOrderQueryParams(symbol, futuresContract, orderId)); } } return getOrder(params.toArray(new OkCoinFuturesOrderQueryParams[params.size()])); }
@Override public List<Ticker> getTickers(Params params) throws IOException { try { return Arrays.stream(getBitfinexTickers(exchange.getExchangeSymbols())) .map(BitfinexAdapters::adaptTicker) .collect(Collectors.toList()); } catch (BitfinexException e) { throw BitfinexErrorAdapter.adapt(e); } }
public static void main(String[] args) throws IOException { exchange = ExchangeFactory.INSTANCE.createExchange(BiboxExchange.class.getName()); MarketDataService marketDataService = exchange.getMarketDataService(); System.out.println(Arrays.toString(exchange.getExchangeSymbols().toArray())); generic(marketDataService); raw((BiboxMarketDataServiceRaw) marketDataService); }
@Override public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException { GateioOpenOrders openOrders = super.getGateioOpenOrders(); Collection<CurrencyPair> currencyPairs = exchange.getExchangeSymbols(); return GateioAdapters.adaptOpenOrders(openOrders, currencyPairs); }
public static void main(String[] args) throws IOException { exchange = ExchangeFactory.INSTANCE.createExchange(ZaifExchange.class.getName()); MarketDataService marketDataService = exchange.getMarketDataService(); System.out.println(Arrays.toString(exchange.getExchangeSymbols().toArray())); generic(marketDataService); raw((ZaifMarketDataServiceRaw) marketDataService); }
public static void main(String[] args) throws IOException { exchange = ExchangeFactory.INSTANCE.createExchange(BittrexExchange.class.getName()); MarketDataService marketDataService = exchange.getMarketDataService(); System.out.println(Arrays.toString(exchange.getExchangeSymbols().toArray())); generic(marketDataService); raw((BittrexMarketDataServiceRaw) marketDataService); }
public static void main(String[] args) throws IOException { exchange = ExchangeFactory.INSTANCE.createExchange(KucoinExchange.class.getName()); MarketDataService marketDataService = exchange.getMarketDataService(); System.out.println(Arrays.toString(exchange.getExchangeSymbols().toArray())); generic(marketDataService); raw((KucoinMarketDataServiceRaw) marketDataService); }
@Override public AccountInfo getAccountInfo() throws IOException { Collection<CoinfloorBalance> rawBalances = new ArrayList<>(); for (CurrencyPair pair : exchange.getExchangeSymbols()) { CoinfloorBalance balance = getCoinfloorBalance(pair); rawBalances.add(balance); } return CoinfloorAdapters.adaptAccountInfo( exchange.getExchangeMetaData().getCurrencies().keySet(), rawBalances); }
public static void main(String[] args) throws IOException { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(YoBitExchange.class.getName()); System.out.println("ExchangeMetaData toString(): " + exchange.getExchangeMetaData().toString()); System.out.println( "ExchangeMetaData toJSONString(): " + exchange.getExchangeMetaData().toJSONString()); System.out.println("Currency Pairs: " + exchange.getExchangeSymbols()); } }
public static void main(String[] args) throws IOException { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(LivecoinExchange.class.getName()); System.out.println("ExchangeMetaData toString(): " + exchange.getExchangeMetaData().toString()); System.out.println( "ExchangeMetaData toJSONString(): " + exchange.getExchangeMetaData().toJSONString()); System.out.println("Currency Pairs: " + exchange.getExchangeSymbols()); } }
public static void main(String[] args) throws IOException { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(GateioExchange.class.getName()); System.out.println("ExchangeMetaData toString(): " + exchange.getExchangeMetaData().toString()); System.out.println( "ExchangeMetaData toJSONString(): " + exchange.getExchangeMetaData().toJSONString()); System.out.println("Currency Pairs: " + exchange.getExchangeSymbols()); } }
public static void main(String[] args) throws IOException { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(CCEXExchange.class.getName()); System.out.println("ExchangeMetaData toString(): " + exchange.getExchangeMetaData().toString()); System.out.println( "ExchangeMetaData toJSONString(): " + exchange.getExchangeMetaData().toJSONString()); System.out.println("Currency Pairs: " + exchange.getExchangeSymbols()); } }
public boolean checkProductExists(CurrencyPair currencyPair) { boolean currencyPairSupported = false; for (CurrencyPair cp : exchange.getExchangeSymbols()) { if (cp.base.getCurrencyCode().equalsIgnoreCase(currencyPair.base.getCurrencyCode()) && cp.counter .getCurrencyCode() .equalsIgnoreCase(currencyPair.counter.getCurrencyCode())) { currencyPairSupported = true; break; } } return currencyPairSupported; }
public boolean checkProductExists(CurrencyPair currencyPair) { boolean currencyPairSupported = false; for (CurrencyPair cp : exchange.getExchangeSymbols()) { if (cp.base.getCurrencyCode().equalsIgnoreCase(currencyPair.base.getCurrencyCode()) && cp.counter .getCurrencyCode() .equalsIgnoreCase(currencyPair.counter.getCurrencyCode())) { currencyPairSupported = true; break; } } return currencyPairSupported; } }
@Override public Map<CurrencyPair, Fee> getDynamicTradingFees() throws IOException { try { List<CurrencyPair> allCurrencyPairs = exchange.getExchangeSymbols(); return BitfinexAdapters.adaptDynamicTradingFees( getBitfinexDynamicTradingFees(), allCurrencyPairs); } catch (BitfinexException e) { throw BitfinexErrorAdapter.adapt(e); } }
@Override public boolean cancelOrder(String orderId) throws IOException { boolean ret = false; for (CurrencyPair symbol : exchange.getExchangeSymbols()) { for (FuturesContract futuresContract : getExchangeContracts()) { if (cancelOrder(new OkCoinFuturesCancelOrderParams(symbol, futuresContract, orderId))) { ret = true; break; } } } return ret; }
public static void main(String[] args) throws IOException { ExchangeSpecification exSpec = new GateioExchange().getDefaultExchangeSpecification(); exSpec.setShouldLoadRemoteMetaData(true); Exchange exchange = ExchangeFactory.INSTANCE.createExchange(exSpec); System.out.println(exchange.getExchangeSpecification().isShouldLoadRemoteMetaData()); System.out.println(exchange.getExchangeMetaData().toString()); System.out.println(exchange.getExchangeSymbols()); } }