Package com.xeiam.xchange.bitcoinaverage.dto.marketdata

Examples of com.xeiam.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTicker


  private static void raw(Exchange bitcoinAverageExchange) throws IOException {

    BitcoinAverageMarketDataServiceRaw bitcoinAverageMarketDataServiceRaw = (BitcoinAverageMarketDataServiceRaw) bitcoinAverageExchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to EUR
    BitcoinAverageTicker ticker = bitcoinAverageMarketDataServiceRaw.getBitcoinAverageTicker(Currencies.BTC, Currencies.EUR);

    System.out.println("Last: " + ticker.getLast());
    System.out.println("Vol: " + ticker.getVolume());
  }
View Full Code Here


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

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

    Ticker ticker = BitcoinAverageAdapters.adaptTicker(BitcoinAverageTicker, CurrencyPair.BTC_USD);
    System.out.println(ticker.toString());

    assertThat(ticker.getCurrencyPair()).isEqualTo(CurrencyPair.BTC_USD);
View Full Code Here

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

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

    // Verify that the example data was unmarshalled correctly
    assertThat(BitcoinAverageTicker.getLast()).isEqualTo(new BigDecimal("629.45"));
    assertThat(BitcoinAverageTicker.getBid()).isEqualTo(new BigDecimal("628.2"));
    assertThat(BitcoinAverageTicker.getAsk()).isEqualTo(new BigDecimal("631.21"));
    assertThat(BitcoinAverageTicker.getVolume()).isEqualTo(new BigDecimal("118046.63"));
  }
View Full Code Here

  }

  public BitcoinAverageTicker getBitcoinAverageTicker(String tradableIdentifier, String currency) throws IOException {

    // Request data
    BitcoinAverageTicker bitcoinAverageTicker = bitcoinAverage.getTicker(currency);

    return bitcoinAverageTicker;
  }
View Full Code Here

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

    // Request data
    BitcoinAverageTicker bitcoinAverageTicker = getBitcoinAverageTicker(currencyPair.baseSymbol, currencyPair.counterSymbol);

    // Adapt to XChange DTOs
    return BitcoinAverageAdapters.adaptTicker(bitcoinAverageTicker, currencyPair);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTicker

Copyright © 2018 www.massapicom. 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.