Package com.xeiam.xchange.kraken.dto.marketdata

Examples of com.xeiam.xchange.kraken.dto.marketdata.KrakenTicker


    // Interested in the public polling market data feed (no authentication)
    KrakenMarketDataServiceRaw krakenMarketDataService = (KrakenMarketDataServiceRaw) krakenExchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to EUR
    KrakenTicker ticker = krakenMarketDataService.getKrakenTicker(CurrencyPair.BTC_EUR);

    System.out.println("Ticker: " + ticker.toString());
    System.out.println("Currency: " + Currencies.EUR);
    System.out.println("Last: " + ticker.getClose());
    System.out.println("Volume: " + ticker.get24HourVolume().toString());
    System.out.println("High: " + ticker.get24HourHigh().toString());
    System.out.println("Low: " + ticker.get24HourLow().toString());
  }
View Full Code Here


    KrakenTickerResult krakenTickerResult = mapper.readValue(is, KrakenTickerResult.class);
    Map<String, KrakenTicker> krakenTickers = krakenTickerResult.getResult();

    // Verify that the example data was unmarshalled correctly
    assertThat(krakenTickers.get("ZEURXLTC")).isEqualTo(null);
    KrakenTicker krakenTicker = krakenTickers.get("XXBTZEUR");
    assertThat(krakenTicker.getAsk().getPrice()).isEqualTo(new BigDecimal("562.26651"));
    assertThat(krakenTicker.getAsk().getVolume()).isEqualTo(new BigDecimal("1"));
    assertThat(krakenTicker.getBid().getPrice()).isEqualTo(new BigDecimal("560.46600"));
    assertThat(krakenTicker.getBid().getVolume()).isEqualTo(new BigDecimal("1"));
    assertThat(krakenTicker.getClose().getPrice()).isEqualTo(new BigDecimal("560.87711"));
    assertThat(krakenTicker.getClose().getVolume()).isEqualTo(new BigDecimal("0.01447739"));
    assertThat(krakenTicker.getTodaysVolume()).isEqualTo(new BigDecimal("84.23095922"));
    assertThat(krakenTicker.get24HourVolume()).isEqualTo(new BigDecimal("600.91850325"));
    assertThat(krakenTicker.getTodaysVolumeAvg()).isEqualTo(new BigDecimal("562.19735"));
    assertThat(krakenTicker.get24HourVolumeAvg()).isEqualTo(new BigDecimal("576.77284"));
    assertThat(krakenTicker.getTodaysNumTrades()).isEqualTo(new BigDecimal("305"));
    assertThat(krakenTicker.get24HourNumTrades()).isEqualTo(new BigDecimal("2783"));
    assertThat(krakenTicker.getTodaysLow()).isEqualTo(new BigDecimal("560.00000"));
    assertThat(krakenTicker.get24HourLow()).isEqualTo(new BigDecimal("560.00000"));
    assertThat(krakenTicker.getTodaysHigh()).isEqualTo(new BigDecimal("570.00000"));
    assertThat(krakenTicker.get24HourHigh()).isEqualTo(new BigDecimal("591.11000"));
    assertThat(krakenTicker.getOpen()).isEqualTo(new BigDecimal("568.98910"));
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.kraken.dto.marketdata.KrakenTicker

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.