Package com.xeiam.xchange.dto.marketdata

Examples of com.xeiam.xchange.dto.marketdata.Ticker$Builder


  }

  private static void generic(PollingMarketDataService marketDataService) throws IOException {

    // Get the latest ticker data showing BTC to USD
    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);

    System.out.println(ticker.toString());
  }
View Full Code Here


  }

  public static void generic() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    // Get the latest ticker data showing BTC to CNY
    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_CAD);

    System.out.println("Date: " + ticker.getTimestamp());

    System.out.println("Last: " + ticker.getLast().toString());
    System.out.println("Volume: " + ticker.getVolume().toString());
    System.out.println("High: " + ticker.getHigh().toString());
    System.out.println("Low: " + ticker.getLow().toString());

  }
View Full Code Here

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

    Ticker ticker = CampBXAdapters.adaptTicker(campBXTicker, CurrencyPair.BTC_USD);

    assertThat(ticker.getLast()).isEqualTo("13.30");
    assertThat(ticker.getBid()).isEqualTo("13.30");
    assertThat(ticker.getAsk()).isEqualTo("13.52");

  }
View Full Code Here

    raw((HitbtcMarketDataServiceRaw) marketDataService);
  }

  private static void generic(PollingMarketDataService marketDataService) throws IOException {

    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
    System.out.println(ticker);

    OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_USD);
    System.out.println(orderBook);
  }
View Full Code Here

    // Interested in the polling market data feed
    PollingMarketDataService marketDataService = openExchangeRates.getPollingMarketDataService();

    // Get the latest ticker data showing EUR/USD
    Ticker ticker = marketDataService.getTicker(CurrencyPair.EUR_USD);
    System.out.println("Last: " + ticker.getLast().toString());

    // Alternate way to print out ticker currency and amount
    System.out.println("ticker: " + ticker.toString());

    // Request another ticker. it will return a cached object
    ticker = marketDataService.getTicker(CurrencyPair.JPY_USD);
    System.out.println("cached Last: " + ticker.getLast().toString());

    // Request BTC ticker. it will return a cached object
    ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
    System.out.println("cached Last: " + ticker.getLast().toString());
  }
View Full Code Here

    PollingMarketDataService mintPalGenericMarketDataService = mintPal.getPollingMarketDataService();

    Collection<CurrencyPair> currencyPairs = mintPalGenericMarketDataService.getExchangeSymbols();
    System.out.println(currencyPairs);

    Ticker ticker = mintPalGenericMarketDataService.getTicker(CurrencyPair.LTC_BTC);
    System.out.println(ticker);

    OrderBook orderBook = mintPalGenericMarketDataService.getOrderBook(CurrencyPair.LTC_BTC);
    System.out.println(orderBook);
View Full Code Here

    // Interested in the public polling market data feed (no authentication)
    PollingMarketDataService marketDataService = bitcoinChartsExchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC/bitstampUSD
    CurrencyPair currencyPair = new CurrencyPair(Currencies.BTC, "bitstampUSD");
    Ticker ticker = marketDataService.getTicker(currencyPair);

    double value = ticker.getLast().doubleValue();

    String currency = ticker.getCurrencyPair().counterSymbol.toString();
    System.out.println("bitstampUSD Last: " + currency + "-" + value);
    System.out.println("bitstampUSD Last: " + ticker.getLast().toString());

  }
View Full Code Here

    // 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");
    assertThat(ticker.getLow().toString()).isEqualTo("1538");
    assertThat(ticker.getHigh().toString()).isEqualTo("1555");
    assertThat(ticker.getVolume()).isEqualTo(new BigDecimal("42.67895867"));

  }
View Full Code Here

    System.out.println(pairs);

    CurrencyPair pair = pairs.get(new Random().nextInt(pairs.size()));
    System.out.println("Market data for " + pair + ":");

    Ticker ticker = marketDataService.getTicker(pair);
    System.out.println(ticker);

    OrderBook orderBook = marketDataService.getOrderBook(pair);
    System.out.println(orderBook);
View Full Code Here

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

    Ticker genericTicker = BTCCentralAdapters.adaptTicker(btcCentralTicker, CurrencyPair.BTC_EUR);

    assertEquals(genericTicker.getAsk(), new BigDecimal("20.4"));
    assertEquals(genericTicker.getBid(), new BigDecimal("20.1"));
    assertEquals(genericTicker.getHigh(), new BigDecimal("20.74"));
    assertEquals(genericTicker.getLow(), new BigDecimal("20.2"));
    assertEquals(genericTicker.getLast(), new BigDecimal("20.2"));
    assertEquals(genericTicker.getVolume(), new BigDecimal("148.80193218"));

  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.marketdata.Ticker$Builder

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.