class ItBitTradeServiceRaw extends ItBitBaseService {

  /**
   * Constructor
   *
   * @param exchange
   */
  public ItBitTradeServiceRaw(Exchange exchange) {
    super(exchange);
  }

  public ItBitOrder[] getItBitOpenOrders(CurrencyPair currencyPair) throws IOException {
    CurrencyPair exchangePair = ItBitAdapters.adaptCurrencyPairToExchange(currencyPair);
    ItBitOrder[] orders =
        itBitAuthenticated.getOrders(
            signatureCreator,
            new Date().getTime(),
            exchange.getNonceFactory(),
            exchangePair.base.getCurrencyCode() + exchangePair.counter.getCurrencyCode(),
            "1",
            "1000",
            "open",
            walletId);

    return orders;
  }

  /**
   * Retrieves the set of orders with the given status.
   *
   * @param status
   * @param instrument XBTEUR, XBTUSD ...
   * @return
   * @throws IOException
   */
  public ItBitOrder[] getItBitOrders(String status, String instrument) throws IOException {

    ItBitOrder[] orders =
        itBitAuthenticated.getOrders(
            signatureCreator,
            new Date().getTime(),
            exchange.getNonceFactory(),
            instrument,
            "1",
            "1000",
            status,
            walletId);

    return orders;
  }

  public ItBitOrder getItBitOrder(String orderId) throws IOException {

    ItBitOrder order =
        itBitAuthenticated.getOrder(
            signatureCreator, new Date().getTime(), exchange.getNonceFactory(), walletId, orderId);

    return order;
  }

  public ItBitOrder placeItBitLimitOrder(LimitOrder limitOrder) throws IOException {

    String side = limitOrder.getType().equals(OrderType.BID) ? "buy" : "sell";
    CurrencyPair exchangePair =
        ItBitAdapters.adaptCurrencyPairToExchange(limitOrder.getCurrencyPair());
    String amount = ItBitAdapters.formatCryptoAmount(limitOrder.getOriginalAmount());
    String price = ItBitAdapters.formatFiatAmount(limitOrder.getLimitPrice());

    ItBitOrder postOrder =
        itBitAuthenticated.postOrder(
            signatureCreator,
            new Date().getTime(),
            exchange.getNonceFactory(),
            walletId,
            new ItBitPlaceOrderRequest(
                side,
                "limit",
                exchangePair.base.getCurrencyCode(),
                amount,
                price,
                exchangePair.base.getCurrencyCode() + exchangePair.counter.getCurrencyCode(),
                (limitOrder.getOrderFlags().contains(ItBitOrderFlags.POST_ONLY))));

    return postOrder;
  }

  public void cancelItBitOrder(String orderId) throws IOException {

    itBitAuthenticated.cancelOrder(
        signatureCreator, new Date().getTime(), exchange.getNonceFactory(), walletId, orderId);
  }

  public ItBitOrder[] getItBitOrderHistory(String currency, String pageNum, String pageLen)
      throws IOException {

    ItBitOrder[] orders =
        itBitAuthenticated.getOrders(
            signatureCreator,
            new Date().getTime(),
            exchange.getNonceFactory(),
            currency,
            pageNum,
            pageLen,
            "filled",
            walletId);
    return orders;
  }

  public ItBitTradeHistory getUserTradeHistory(
      String lastExecutionId, Integer page, Integer perPage, Date rangeStart, Date rangeEnd)
      throws IOException, ItBitException {<FILL_FUNCTION_BODY>}
}

    return itBitAuthenticated.getUserTradeHistory(
        signatureCreator,
        System.currentTimeMillis(),
        exchange.getNonceFactory(),
        walletId,
        lastExecutionId,
        page,
        perPage,
        rangeStart,
        rangeEnd);
  
<methods>public void <init>(org.knowm.xchange.Exchange) <variables>protected final non-sealed java.lang.String apiKey,protected final non-sealed org.knowm.xchange.itbit.ItBitAuthenticated itBitAuthenticated,protected final non-sealed org.knowm.xchange.itbit.ItBit itBitPublic,protected final non-sealed ParamsDigest signatureCreator,protected java.lang.String userId,protected java.lang.String walletId