class CexIOTradeService extends CexIOTradeServiceRaw implements TradeService {

  /**
   * Constructor
   *
   * @param exchange
   */
  public CexIOTradeService(Exchange exchange) {

    super(exchange);
  }

  @Override
  public OpenOrders getOpenOrders() throws IOException {
    return getOpenOrders(createOpenOrdersParams());
  }

  @Override
  public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {

    List<CexIOOrder> cexIOOrderList;
    if (params instanceof OpenOrdersParamCurrencyPair) {
      cexIOOrderList = getCexIOOpenOrders(((OpenOrdersParamCurrencyPair) params).getCurrencyPair());
    } else {
      cexIOOrderList = getCexIOOpenOrders();
    }

    return CexIOAdapters.adaptOpenOrders(cexIOOrderList);
  }

  @Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    /*
    Only in market order!
    Presently, the exchange is designed in such way that, depending on the BID/ASK the currency changes
      (accordingly, you must specify the amount in another currency)
    Example: CurrencyPair.BCH_USD, Order.OrderType.ASK, Amount = 0.02 (BCH)
    Example: CurrencyPair.BCH_USD, Order.OrderType.BID, Amount = 20 (USD)
    Сurrently cannot be implemented!
    */

    throw new NotYetImplementedForExchangeException();
  }

  @Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
    CexIOOrder order = placeCexIOLimitOrder(limitOrder);
    return Long.toString(order.getId());
  }

  @Override
  public boolean cancelOrder(String orderId) throws IOException {
    return cancelCexIOOrder(orderId);
  }

  @Override
  public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
    if (orderParams instanceof CancelOrderByIdParams) {
      return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId());
    } else if (orderParams instanceof CancelOrderByCurrencyPair) {
      cancelCexIOOrders(((CancelOrderByCurrencyPair) orderParams).getCurrencyPair());
      return true;
    } else {
      throw new IllegalArgumentException(
          String.format("Unknown parameter type: %s", orderParams.getClass()));
    }
  }

  @Override
  public String changeOrder(LimitOrder limitOrder) throws IOException {
    CexIOCancelReplaceOrderResponse response =
        cancelReplaceCexIOOrder(
            limitOrder.getCurrencyPair(),
            limitOrder.getType(),
            limitOrder.getId(),
            limitOrder.getOriginalAmount(),
            limitOrder.getLimitPrice());
    return response.getId();
  }

  @Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {<FILL_FUNCTION_BODY>}

  @Override
  public TradeHistoryParams createTradeHistoryParams() {
    throw new NotAvailableFromExchangeException();
  }

  @Override
  public OpenOrdersParams createOpenOrdersParams() {
    return null;
    // TODO: return new DefaultOpenOrdersParamCurrencyPair();
  }

  @Override
  public Collection<Order> getOrder(OrderQueryParams... orderQueryParams) throws IOException {
    List<Order> orders = new ArrayList<>(orderQueryParams.length);
    for (OrderQueryParams params : orderQueryParams) {
      CexIOOpenOrder cexIOOrder = getOrderDetail(params.getOrderId());
      orders.add(CexIOAdapters.adaptOrder(cexIOOrder));
    }
    return orders;
  }
}

    List<UserTrade> trades = new ArrayList<>();
    for (CexIOArchivedOrder cexIOArchivedOrder : archivedOrders(params)) {
      if (cexIOArchivedOrder.status.equals(
          "c")) // "d" — done (fully executed), "c" — canceled (not executed), "cd" — cancel-done//
        // (partially executed)
        continue;
      trades.add(CexIOAdapters.adaptArchivedOrder(cexIOArchivedOrder));
    }
    return new UserTrades(trades, Trades.TradeSortType.SortByTimestamp);
  
<methods>public void <init>(org.knowm.xchange.Exchange) ,public List<org.knowm.xchange.cexio.dto.trade.CexIOArchivedOrder> archivedOrders(org.knowm.xchange.service.trade.params.TradeHistoryParams) throws java.io.IOException,public boolean cancelCexIOOrder(java.lang.String) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOCancelAllOrdersResponse cancelCexIOOrders(org.knowm.xchange.currency.CurrencyPair) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOCancelReplaceOrderResponse cancelReplaceCexIOOrder(org.knowm.xchange.currency.CurrencyPair, org.knowm.xchange.dto.Order.OrderType, java.lang.String, java.math.BigDecimal, java.math.BigDecimal) throws org.knowm.xchange.exceptions.ExchangeException, java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexioClosePosition closePosition(org.knowm.xchange.currency.CurrencyPair, java.lang.String) throws java.io.IOException,public List<org.knowm.xchange.cexio.dto.trade.CexIOOrder> getCexIOOpenOrders(org.knowm.xchange.currency.CurrencyPair) throws java.io.IOException,public List<org.knowm.xchange.cexio.dto.trade.CexIOOrder> getCexIOOpenOrders() throws java.io.IOException,public List<org.knowm.xchange.cexio.dto.trade.CexioPosition> getOpenPositions(org.knowm.xchange.currency.CurrencyPair) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOOpenOrder getOrderDetail(java.lang.String) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOFullOrder getOrderFullDetail(java.lang.String) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOOrderWithTransactions getOrderTransactions(java.lang.String) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexioPosition getPosition(java.lang.String) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexioOpenPosition openCexIOPosition(org.knowm.xchange.currency.CurrencyPair, java.math.BigDecimal, org.knowm.xchange.currency.Currency, java.lang.Integer, org.knowm.xchange.cexio.dto.trade.CexioPositionType, java.lang.Boolean, java.math.BigDecimal, java.math.BigDecimal) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOOrder placeCexIOLimitOrder(org.knowm.xchange.dto.trade.LimitOrder) throws java.io.IOException,public org.knowm.xchange.cexio.dto.trade.CexIOOrder placeCexIOMarketOrder(org.knowm.xchange.dto.trade.MarketOrder) throws java.io.IOException<variables>