Package com.xeiam.xchange.dto.marketdata

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


    openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders);

    Thread.sleep(2000);

    Trades tradeHistory = tradeService.getTradeHistory(CurrencyPair.LTC_BTC);
    System.out.println(tradeHistory);
  }
View Full Code Here


    raw();
  }

  private static void generic() throws IOException {

    Trades trades = tradeService.getTradeHistory(10);
    System.out.println("Trade count: " + trades.getTrades().size());
    for (Trade trade : trades.getTrades()) {
      System.out.println(trade);
    }
  }
View Full Code Here

    System.out.println(ticker);

    OrderBook oderBook = marketDataService.getOrderBook(CurrencyPair.BTC_CNY);
    System.out.println(oderBook);

    Trades tradeHistory = marketDataService.getTrades(CurrencyPair.BTC_CNY);
    System.out.println(tradeHistory);

    List<Trade> trades = tradeHistory.getTrades();
    if (trades.size() > 1) {
      Trade trade = trades.get(trades.size() - 2);
      tradeHistory = marketDataService.getTrades(CurrencyPair.BTC_CNY, Long.valueOf(trade.getId()));
      System.out.println(tradeHistory);
    }
View Full Code Here

    Exchange anx = ANXExamplesUtils.createExchange();

    // Interested in the private trading functionality (authentication)
    PollingTradeService tradeService = anx.getPollingTradeService();

    Trades trades = tradeService.getTradeHistory();
    for (Trade trade : trades.getTrades()) {
      System.out.println(trade);
    }
  }
View Full Code Here

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

    // Get the latest trade data for BTC/EUR
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_EUR);

    System.out.println(trades.toString());
  }
View Full Code Here

  }

  public static void generic() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    // Get the latest trade data for BTC/CNY
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_CNY);

    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());

    trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, trades.getTrades().get(trades.getTrades().size() - 3).getTimestamp().getTime() / 1000, 20, "time");

    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());
  }
View Full Code Here

  }

  private static void generic(PollingMarketDataService marketDataService) throws IOException {

    // Get the latest trade data for BTC/USD
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD);
    System.out.println("Trades, default. Size= " + trades.getTrades().size());

    trades = marketDataService.getTrades(CurrencyPair.BTC_USD, BitstampMarketDataServiceRaw.BitstampTime.HOUR);
    System.out.println("Trades, hour= " + trades.getTrades().size());

    trades = marketDataService.getTrades(CurrencyPair.BTC_USD, BitstampMarketDataServiceRaw.BitstampTime.MINUTE);
    System.out.println("Trades, minute= " + trades.getTrades().size());
    System.out.println(trades.toString());
  }
View Full Code Here

  }

  private static void generic(PollingMarketDataService marketDataService, CurrencyPair pair) throws IOException {

    // Get the latest trade data for BTC/EUR
    Trades trades = marketDataService.getTrades(pair);
    System.out.println("Trades, Size= " + trades.getTrades().size());
    System.out.println(trades.toString());
  }
View Full Code Here

    // String orderId = tradeService.placeMarketOrder(marketOrder);
    // System.out.println("Order Id: " + orderId);

    int page = 1; // optional
    int limit = 3; // optional
    Trades trades = tradeService.getTradeHistory(page, limit);
    System.out.println(trades);
  }
View Full Code Here

  }

  public static void generic() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    // Get the latest trade data for BTC/CNY
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_CNY);

    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());

    // Get the latest trade data for BTC/CNY, limit 10
    trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, null, 10);
    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());

    // Get the offset trade data for BTC/CNY
    trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, 6097616);

    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());

    System.out.println("LastId=" + trades.getlastID());

    // Get the offset trade data for BTC/CNY, limit 10
    trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, 6097616, 10);

    System.out.println(trades);
    System.out.println("NumTrades=" + trades.getTrades().size());

    System.out.println("LastId=" + trades.getlastID());
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.marketdata.Trades

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.