Examples of CryptoTradeTicker


Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

  }

  @Override
  public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {

    CryptoTradeTicker cryptoTradeTicker = super.getCryptoTradeTicker(currencyPair);

    return CryptoTradeAdapters.adaptTicker(currencyPair, cryptoTradeTicker);
  }
View Full Code Here

Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

    // Read in the JSON from the example resources
    InputStream is = CryptoTradeAdapterTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CryptoTradeTicker cryptoTradeTicker = mapper.readValue(is, CryptoTradeTicker.class);

    Ticker adaptedTicker = CryptoTradeAdapters.adaptTicker(CurrencyPair.BTC_USD, cryptoTradeTicker);

    assertThat(adaptedTicker.getLast()).isEqualTo(new BigDecimal("128"));
    assertThat(adaptedTicker.getLow()).isEqualTo(new BigDecimal("127.9999"));
View Full Code Here

Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

    super(CryptoTrade.class, exchangeSpecification);
  }

  public CryptoTradeTicker getCryptoTradeTicker(CurrencyPair currencyPair) throws CryptoTradeException, IOException {

    CryptoTradeTicker cryptoTradeTicker = cryptoTradeProxy.getTicker(currencyPair.baseSymbol.toLowerCase(), currencyPair.counterSymbol.toLowerCase());

    return handleResponse(cryptoTradeTicker);
  }
View Full Code Here

Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

    }

    final String status = statusNode != null ? statusNode.path("status").asText() : null;
    final String error = statusNode != null ? statusNode.path("error").asText() : null;

    return new CryptoTradeTicker(last, low, high, volumeTradeCurrency, volumePriceCurrency, minAsk, maxBid, status, error);
  }
View Full Code Here

Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

      final ObjectNode dataNode = (ObjectNode) rootNode.get(0);
      final Iterator<Entry<String, JsonNode>> tickersArray = dataNode.fields();
      while (tickersArray.hasNext()) {
        final Entry<String, JsonNode> tickerData = tickersArray.next();
        final CurrencyPair pair = CurrencyPairDeserializer.getCurrencyPairFromString(tickerData.getKey());
        final CryptoTradeTicker ticker = CryptoTradeTickerDeserializer.getTickerFromJsonNode(tickerData.getValue());
        tickers.put(pair, ticker);
      }
    }
    return tickers;
  }
View Full Code Here

Examples of com.xeiam.xchange.cryptotrade.dto.marketdata.CryptoTradeTicker

    System.out.println(currencyPairs);

    CryptoTradePair currencyPair = marketDataService.getCryptoTradePairInfo(CurrencyPair.BTC_USD);
    System.out.println(currencyPair);

    CryptoTradeTicker ticker = marketDataService.getCryptoTradeTicker(CurrencyPair.BTC_USD);
    System.out.println(ticker);

    Map<CurrencyPair, CryptoTradeTicker> tickers = marketDataService.getCryptoTradeTickers();
    System.out.println(tickers);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.