Package com.xeiam.xchange.lakebtc.dto.marketdata

Examples of com.xeiam.xchange.lakebtc.dto.marketdata.LakeBTCTickers


    InputStream is = LakeBTCMarketDataJsonTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();

    LakeBTCTickers tickers = mapper.readValue(is, LakeBTCTickers.class);

    LakeBTCTicker cnyTicker = tickers.getCny();
    Ticker adaptedTicker = LakeBTCAdapters.adaptTicker(cnyTicker, CurrencyPair.BTC_CNY);

    assertThat(adaptedTicker.getAsk()).isEqualTo("3524.07");
    assertThat(adaptedTicker.getBid()).isEqualTo("3517.13");
    assertThat(adaptedTicker.getLow()).isEqualTo("3480.07");
View Full Code Here


    InputStream is = LakeBTCMarketDataJsonTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();

    LakeBTCTickers tickers = mapper.readValue(is, LakeBTCTickers.class);

    LakeBTCTicker cnyTicker = tickers.getCny();
    assertThat(cnyTicker.getAsk()).isEqualTo("3524.07");
    assertThat(cnyTicker.getBid()).isEqualTo("3517.13");
    assertThat(cnyTicker.getLast()).isEqualTo("3524.07");
    assertThat(cnyTicker.getHigh()).isEqualTo("3584.97");
    assertThat(cnyTicker.getLow()).isEqualTo("3480.07");
    assertThat(cnyTicker.getVolume()).isEqualTo("5964.7677");

    LakeBTCTicker usdTicker = tickers.getUsd();
    assertThat(usdTicker.getAsk()).isEqualTo("564.63");
    assertThat(usdTicker.getBid()).isEqualTo("564.63");
    assertThat(usdTicker.getLast()).isEqualTo("564.4");
    assertThat(usdTicker.getHigh()).isEqualTo("573.83");
    assertThat(usdTicker.getLow()).isEqualTo("557.7");
View Full Code Here

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

    LakeBTCTicker lakeBTCTicker;
    LakeBTCTickers lakeBTCTickers = getLakeBTCTickers();

    if (CurrencyPair.BTC_USD.equals(currencyPair)) {
      lakeBTCTicker = lakeBTCTickers.getUsd();
    }
    else if (CurrencyPair.BTC_CNY.equals(currencyPair)) {
      lakeBTCTicker = lakeBTCTickers.getCny();
    }
    else {
      throw new NotAvailableFromExchangeException();
    }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.lakebtc.dto.marketdata.LakeBTCTickers

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.