Examples of VirtExTicker


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

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

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

    Ticker ticker = VirtExAdapters.adaptTicker(VirtExTicker, CurrencyPair.BTC_CAD);
    System.out.println(ticker.toString());

    assertThat(ticker.getLast().toString()).isEqualTo("12.32900");
View Full Code Here

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

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

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

    // Verify that the example data was unmarshalled correctly
    assertThat(VirtExTicker.getLast()).isEqualTo(new BigDecimal("12.32900"));
    assertThat(VirtExTicker.getHigh()).isEqualTo(new BigDecimal("12.37989"));
    assertThat(VirtExTicker.getLow()).isEqualTo(new BigDecimal("11.64001"));
    assertThat(VirtExTicker.getVolume()).isEqualTo(new BigDecimal("1866.56"));
  }
View Full Code Here

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

  }

  public VirtExTicker getVirtExTicker(String currency) throws IOException {

    // Request data
    VirtExTicker virtExTicker = virtEx.getTicker(currency);

    // Adapt to XChange DTOs
    return virtExTicker;
  }
View Full Code Here

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

    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"));
    assertThat(virtExTicker.getVolume()).isEqualTo(new BigDecimal("284.231600000"));
    assertThat(virtExTicker.getSell()).isEqualTo(new BigDecimal("545.06000"));
    assertThat(virtExTicker.getBuy()).isEqualTo(new BigDecimal("545.03000"));

  }
View Full Code Here

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

  }

  private static void raw(VirtExMarketDataServiceRaw marketDataService) throws IOException {

    // Get the latest ticker data showing BTC to CAD
    VirtExTicker ticker = marketDataService.getVirtExTicker(CurrencyPair.BTC_CAD);

    System.out.println("Currency: " + Currencies.CAD);
    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
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.