Package com.xeiam.xchange.campbx.dto.marketdata

Examples of com.xeiam.xchange.campbx.dto.marketdata.CampBXTicker


    // Read in the JSON from the example resources
    InputStream is = TickerJSONTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    ObjectMapper mapper = new ObjectMapper();
    CampBXTicker campBXTicker = mapper.readValue(is, CampBXTicker.class);

    // Verify that the example data was unmarshalled correctly
    assertThat(campBXTicker.getLast()).isEqualTo(new BigDecimal("13.30"));
    assertThat(campBXTicker.getBid()).isEqualTo(new BigDecimal("13.30"));
    assertThat(campBXTicker.getAsk()).isEqualTo(new BigDecimal("13.52"));
  }
View Full Code Here


  }

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

    CampBXTicker campbxTicker = getCampBXTicker();

    return CampBXAdapters.adaptTicker(campbxTicker, currencyPair);
  }
View Full Code Here

    this.campBX = RestProxyFactory.createProxy(CampBX.class, exchangeSpecification.getSslUri());
  }

  public CampBXTicker getCampBXTicker() throws IOException {

    CampBXTicker campbxTicker = campBX.getTicker();

    if (!campbxTicker.isError()) {
      return campbxTicker;
    }
    else {
      throw new ExchangeException("Error calling getCampBXTicker(): " + campbxTicker.getError());
    }
  }
View Full Code Here

    // Read in the JSON from the example resources
    InputStream is = CampBXAdapterTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // 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");
View Full Code Here

    // Interested in the public polling market data feed (no authentication)
    CampBXMarketDataServiceRaw campBXspecificMarketDataService = (CampBXMarketDataServiceRaw) campBXExchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to USD
    CampBXTicker campBXTicker = campBXspecificMarketDataService.getCampBXTicker();

    System.out.println("Last: " + campBXTicker.getLast());
    System.out.println("Bid: " + campBXTicker.getBid());
    System.out.println("Ask: " + campBXTicker.getAsk());

    // Get the latest order book data for BTC/USD
    CampBXOrderBook campBXOrderBook = campBXspecificMarketDataService.getCampBXOrderBook();

    System.out.println("Order book: " + campBXOrderBook);
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.campbx.dto.marketdata.CampBXTicker

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.