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

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


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

    ObjectMapper mapper = new ObjectMapper();
    CampBXOrderBook orderBook = mapper.readValue(is, CampBXOrderBook.class);

    // Verify that the example data was unmarshalled correctly
    assertThat(orderBook.getBids().get(0).get(0)).isEqualTo(new BigDecimal("13.3"));
    assertThat(orderBook.getBids().get(0).get(1)).isEqualTo(new BigDecimal("0.00021609"));
    assertThat(orderBook.getAsks().get(0).get(0)).isEqualTo(new BigDecimal("99.99"));
    assertThat(orderBook.getAsks().get(0).get(1)).isEqualTo(new BigDecimal("0.10000000"));
  }
View Full Code Here


  }

  @Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {

    CampBXOrderBook campBXOrderBook = getCampBXOrderBook();

    return CampBXAdapters.adaptOrders(campBXOrderBook, currencyPair);
  }
View Full Code Here

    }
  }

  public CampBXOrderBook getCampBXOrderBook() throws IOException {

    CampBXOrderBook campBXOrderBook = campBX.getOrderBook();

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

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

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

    OrderBook orderBook = CampBXAdapters.adaptOrders(bitstampOrderBook, CurrencyPair.BTC_USD);
    assertThat(orderBook.getBids().size()).isEqualTo(36);

    // verify all fields filled
View Full Code Here

    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.CampBXOrderBook

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.