Package com.xeiam.xchange.coinbase.dto.marketdata

Examples of com.xeiam.xchange.coinbase.dto.marketdata.CoinbaseSpotPriceHistory


    final String currency = currencyPair.counterSymbol;
    final CoinbasePrice buyPrice = super.getCoinbaseBuyPrice(BigDecimal.ONE, currency);
    final CoinbasePrice sellPrice = super.getCoinbaseSellPrice(BigDecimal.ONE, currency);
    final CoinbaseMoney spotRate = super.getCoinbaseSpotRate(currency);

    final CoinbaseSpotPriceHistory coinbaseSpotPriceHistory =
        (args != null && args.length > 0 && args[0] != null && args[0] instanceof Boolean && (Boolean) args[0]) ? super.getCoinbaseHistoricalSpotRates() : null;

    return CoinbaseAdapters.adaptTicker(currencyPair, buyPrice, sellPrice, spotRate, coinbaseSpotPriceHistory);
  }
View Full Code Here


    CoinbaseMoney spotRate = marketDataService.getCoinbaseSpotRate("EUR");
    System.out.println("Spot Rate: " + spotRate);

    int page = 2;
    CoinbaseSpotPriceHistory spotPriceHistory = marketDataService.getCoinbaseHistoricalSpotRates(page);
    List<CoinbaseHistoricalSpotPrice> spotPriceHistoryList = spotPriceHistory.getSpotPriceHistory();
    for (CoinbaseHistoricalSpotPrice coinbaseHistoricalSpotPrice : spotPriceHistoryList) {
      System.out.println(coinbaseHistoricalSpotPrice);
    }
    System.out.println("...Retrieved " + spotPriceHistoryList.size() + " historical spot rates.");
  }
View Full Code Here

      spotPriceHistoryString = scanner.useDelimiter("\\A").next();
    } finally {
      scanner.close();
    }

    CoinbaseSpotPriceHistory spotPriceHistory = CoinbaseSpotPriceHistory.fromRawString(spotPriceHistoryString);

    Ticker ticker = CoinbaseAdapters.adaptTicker(CurrencyPair.BTC_USD, price, price, spotPrice, spotPriceHistory);

    assertThat(ticker).isEqualsToByComparingFields(expectedTicker);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.coinbase.dto.marketdata.CoinbaseSpotPriceHistory

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.