Package com.xeiam.xchange.virtex.v2.dto.marketdata

Examples of com.xeiam.xchange.virtex.v2.dto.marketdata.VirtExTicker


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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    VirtExTickerWrapper virtExTickerWrapper = mapper.readValue(is, VirtExTickerWrapper.class);
    VirtExTicker virtExTicker = virtExTickerWrapper.getTicker();

    // Verify that the example data was unmarshalled correctly
    assertThat(virtExTicker.getLast()).isEqualTo(new BigDecimal("545.060000000"));
    assertThat(virtExTicker.getHigh()).isEqualTo(new BigDecimal("574.000000000"));
    assertThat(virtExTicker.getLow()).isEqualTo(new BigDecimal("538.000000000"));
View Full Code Here


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

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

    Trades trades = VirtExAdapters.adaptTrades(VirtExTrades.getTrades(), CurrencyPair.BTC_CAD);
    assertThat(trades.getTrades().size()).isEqualTo(632);

    // Verify all fields filled
    assertThat(trades.getTrades().get(0).getPrice().doubleValue() == 545.060000000);
    assertThat(trades.getTrades().get(0).getTradableAmount().doubleValue() == 1.189100000);
View Full Code Here

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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    VirtExTradesWrapper virtExTradesWrapper = mapper.readValue(is, VirtExTradesWrapper.class);
    ArrayList<VirtExTrade> virtexTrades = virtExTradesWrapper.getTrades();

    // Verify that the example data was unmarshalled correctly
    assertThat(virtexTrades.get(0).getPrice()).isEqualTo(new BigDecimal("545.060000000"));
  }
View Full Code Here

  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);
    this.pollingMarketDataService = new VirtExMarketDataService(exchangeSpecification);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.virtex.v2.dto.marketdata.VirtExTicker

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.