Examples of Ticker


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

    BigDecimal last = rawRetObj.getLast();
    BigDecimal bid = rawRetObj.getBid();
    BigDecimal ask = rawRetObj.getAsk();
    BigDecimal low = rawRetObj.getLow();
    BigDecimal high = rawRetObj.getHigh();
    Ticker genericTicker =
        new Ticker.Builder().volume(rawRetObj.getVolume()).ask(ask).currencyPair(new CurrencyPair("BTC", "GBP")).bid(bid).high(high).low(low).last(last).build();

    synchronized (cachedDataSynchronizationObject) {
      cachedTicker = genericTicker;
    }
View Full Code Here

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

    try {
      rawRetObj = streamObjectMapper.readValue(data, CoinfloorTicker.class);
    } catch (IOException e) {
      throw new ExchangeException("JSON parse error", e);
    }
    Ticker genericTicker;

    synchronized (cachedDataSynchronizationObject) {
      // base & counter currencies hard coded in; no way to make it dynamic with return data - may change over time.
      BigDecimal last = (rawRetObj.getLast().doubleValue() == 0 ? cachedTicker.getLast() : rawRetObj.getLast());
      BigDecimal bid = (rawRetObj.getBid().doubleValue() == 0 ? cachedTicker.getBid() : rawRetObj.getBid());
View Full Code Here

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

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

    // Get the latest ticker data showing BTC to USD
    Ticker ticker = marketDataService.getTicker(new CurrencyPair(Currencies.GHs, Currencies.BTC));

    System.out.println("Pair: " + Currencies.GHs + "/" + Currencies.BTC);
    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());
    System.out.println("Bid: " + ticker.getBid().toString());
    System.out.println("Ask: " + ticker.getAsk().toString());
    System.out.println("Timestamp: " + ticker.getTimestamp().toString());
  }
View Full Code Here

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

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

    Ticker ticker = BTCEAdapters.adaptTicker(BTCETicker, CurrencyPair.BTC_USD);

    assertThat(ticker.getLast().toString()).isEqualTo("13.07");
    assertThat(ticker.getLow().toString()).isEqualTo("13");
    assertThat(ticker.getHigh().toString()).isEqualTo("13.23");
    assertThat(ticker.getVolume()).isEqualTo(new BigDecimal("3078.62284"));
    assertThat(ticker.getCurrencyPair()).isEqualTo(CurrencyPair.BTC_USD);

  }
View Full Code Here

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

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

    Ticker ticker = BitstampAdapters.adaptTicker(bitstampTicker, CurrencyPair.BTC_USD);

    assertThat(ticker.getLast().toString()).isEqualTo("134.89");
    assertThat(ticker.getBid().toString()).isEqualTo("134.89");
    assertThat(ticker.getAsk().toString()).isEqualTo("134.92");
    assertThat(ticker.getVolume()).isEqualTo(new BigDecimal("21982.44926674"));
    SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    f.setTimeZone(TimeZone.getTimeZone("UTC"));
    String dateString = f.format(ticker.getTimestamp());
    assertThat(dateString).isEqualTo("2013-10-14 21:45:33");
  }
View Full Code Here

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

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

    // Get the latest ticker data showing BTC to EUR
    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_EUR);
    double value = ticker.getLast().doubleValue();

    System.out.println("Last: " + ticker.getCurrencyPair().counterSymbol + "-" + value);
    System.out.println("Last: " + ticker.getLast().toString());
    System.out.println("Volume: " + ticker.getVolume().toString());
  }
View Full Code Here

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

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

    // Get the latest ticker data showing BTC to CNY.
    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_CNY);
    System.out.println(ticker);
  }
View Full Code Here

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

  }

  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

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

  }

  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

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

    // 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
TOP
Copyright © 2018 www.massapi.com. 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.