Package com.xeiam.xchange.bitcurex.dto.marketdata

Examples of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexTicker


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

    // get data
    BitcurexTicker bitcurexTicker = getBitcurexTicker(currencyPair.counterSymbol);

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


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

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

    Ticker ticker = BitcurexAdapters.adaptTicker(BitcurexTicker, CurrencyPair.BTC_PLN);
    System.out.println(ticker.toString());

    assertThat(ticker.getLast().toString()).isEqualTo("1555");
View Full Code Here

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

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

    // Verify that the example data was unmarshalled correctly
    assertThat(BitcurexTicker.getLast()).isEqualTo(new BigDecimal("1555"));
    assertThat(BitcurexTicker.getHigh()).isEqualTo(new BigDecimal("1555"));
    assertThat(BitcurexTicker.getLow()).isEqualTo(new BigDecimal("1538"));
    assertThat(BitcurexTicker.getVolume()).isEqualTo(new BigDecimal("42.67895867"));
  }
View Full Code Here

  private static void raw(Exchange bitcurex, String currency) throws IOException {

    BitcurexMarketDataServiceRaw bitcurexMarketDataServiceRaw = (BitcurexMarketDataServiceRaw) bitcurex.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to EUR
    BitcurexTicker ticker = bitcurexMarketDataServiceRaw.getBitcurexTicker(currency);

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

TOP

Related Classes of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexTicker

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.