class CoindirectMarketDataService extends CoindirectMarketDataServiceRaw
    implements MarketDataService {
  /**
   * Constructor
   *
   * @param exchange
   */
  public CoindirectMarketDataService(Exchange exchange) {
    super(exchange);
  }

  @Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
    CoindirectOrderbook coindirectOrderbook = getCoindirectOrderbook(currencyPair);
    return CoindirectAdapters.adaptOrderBook(currencyPair, coindirectOrderbook);
  }

  @Override
  public Trades getTrades(CurrencyPair pair, Object... args) throws IOException {
    String history = "1h";

    try {
      if (args[0] != null) history = args[0].toString();
    } catch (Throwable ignored) {
    }

    CoindirectTrades coindirectTrades = getCoindirectTrades(pair, history);

    List<Trade> trades;

    if (coindirectTrades.data == null) {
      trades = new ArrayList<>();
    } else {
      trades =
          coindirectTrades.data.stream()
              .map(
                  at ->
                      new Trade.Builder()
                          .type(Order.OrderType.BID)
                          .originalAmount(at.volume)
                          .currencyPair(pair)
                          .price(at.price)
                          .timestamp(new Date(at.time))
                          .id(Long.toString(at.time))
                          .build())
              .collect(Collectors.toList());
    }

    return new Trades(trades, Trades.TradeSortType.SortByTimestamp);
  }

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

  @Override
  public List<Ticker> getTickers(Params params) throws IOException {
    List<CoindirectMarket> coindirectMarkets = getCoindirectMarkets(1000); /* default max */

    List<Ticker> tickerList = new ArrayList<>();
    for (int i = 0; i < coindirectMarkets.size(); i++) {
      tickerList.add(getTicker(CoindirectAdapters.toCurrencyPair(coindirectMarkets.get(i).symbol)));
    }

    return tickerList;
  }
}

    String history = "24h";
    String grouping = "d";

    try {
      if (args[0] != null) history = args[0].toString();
    } catch (Throwable ignored) {
    }

    try {
      if (args[1] != null) grouping = args[1].toString();
    } catch (Throwable ignored) {
    }

    CoindirectTicker coindirectTicker = getCoindirectTicker(currencyPair, history, grouping);

    if (coindirectTicker.data.size() > 0) {
      CoindirectTickerData coindirectTickerData = coindirectTicker.data.get(0);
      return new Ticker.Builder()
          .currencyPair(currencyPair)
          .open(coindirectTickerData.open)
          .last(coindirectTickerData.close)
          .high(coindirectTickerData.high)
          .low(coindirectTickerData.low)
          .volume(coindirectTickerData.volume)
          .build();
    }

    return new Ticker.Builder().currencyPair(currencyPair).build();
  
<methods>public void <init>(org.knowm.xchange.Exchange) ,public List<org.knowm.xchange.coindirect.dto.marketdata.CoindirectMarket> getCoindirectMarkets(long) throws java.io.IOException,public org.knowm.xchange.coindirect.dto.marketdata.CoindirectOrderbook getCoindirectOrderbook(org.knowm.xchange.currency.CurrencyPair) throws java.io.IOException,public org.knowm.xchange.coindirect.dto.marketdata.CoindirectTicker getCoindirectTicker(org.knowm.xchange.currency.CurrencyPair, java.lang.String, java.lang.String) throws java.io.IOException,public org.knowm.xchange.coindirect.dto.marketdata.CoindirectTrades getCoindirectTrades(org.knowm.xchange.currency.CurrencyPair, java.lang.String) throws java.io.IOException<variables>