class BittrexTradeService extends BittrexTradeServiceRaw implements TradeService {

  /**
   * Constructor
   *
   * @param exchange
   */
  public BittrexTradeService(
      BittrexExchange exchange,
      BittrexAuthenticated bittrex,
      ResilienceRegistries resilienceRegistries) {
    super(exchange, bittrex, resilienceRegistries);
  }

  @Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
    try {
      return placeBittrexLimitOrder(limitOrder);
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  }

  @Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    try {
      return placeBittrexMarketOrder(marketOrder);
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  }

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

  @Override
  public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
    try {
      return new OpenOrders(BittrexAdapters.adaptOpenOrders(getBittrexOpenOrders(params)));
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  }

  @Override
  public boolean cancelOrder(String orderId) throws IOException {<FILL_FUNCTION_BODY>}

  @Override
  public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
    if (orderParams instanceof CancelOrderByIdParams) {
      return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId());
    }
    return false;
  }

  @Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {

    CurrencyPair currencyPair = null;
    Date startDate = null;
    Date endDate = null;

    if (params instanceof TradeHistoryParamCurrencyPair) {
      currencyPair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
    }
    if (params instanceof TradeHistoryParamsTimeSpan) {
      Date start = ((TradeHistoryParamsTimeSpan) params).getStartTime();
      if (start != null) {
        startDate = Date.from(start.toInstant().truncatedTo(ChronoUnit.SECONDS));
      }
      Date end = ((TradeHistoryParamsTimeSpan) params).getEndTime();
      if (end != null) {
        endDate = Date.from(end.toInstant().truncatedTo(ChronoUnit.SECONDS));
      }
    }

    try {
      List<BittrexOrder> tradeHistory =
          getBittrexUserTradeHistory(currencyPair, startDate, endDate);
      return new UserTrades(
          BittrexAdapters.adaptUserTrades(tradeHistory), Trades.TradeSortType.SortByTimestamp);
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  }

  @Override
  public TradeHistoryParams createTradeHistoryParams() {
    return new BittrexTradeHistoryParams();
  }

  @Override
  public OpenOrdersParams createOpenOrdersParams() {
    return new DefaultOpenOrdersParamCurrencyPair();
  }

  @Override
  public Collection<Order> getOrder(OrderQueryParams... orderQueryParams) throws IOException {
    try {
      List<Order> orders = new ArrayList<>(orderQueryParams.length);
      for (OrderQueryParams params : orderQueryParams) {
        BittrexOrder order = getBittrexOrder(params.getOrderId());
        if (order != null) {
          LimitOrder limitOrder = BittrexAdapters.adaptOrder(order);
          orders.add(limitOrder);
        }
      }
      return orders;
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  }
}

    try {
      return BittrexConstants.CLOSED.equalsIgnoreCase(cancelBittrexLimitOrder(orderId).getStatus());
    } catch (BittrexException e) {
      throw BittrexErrorAdapter.adapt(e);
    }
  
<methods>public void <init>(org.knowm.xchange.bittrex.BittrexExchange, org.knowm.xchange.bittrex.BittrexAuthenticated, org.knowm.xchange.client.ResilienceRegistries) ,public org.knowm.xchange.bittrex.dto.trade.BittrexOrder cancelBittrexLimitOrder(java.lang.String) throws java.io.IOException,public org.knowm.xchange.bittrex.dto.batch.BatchResponse[] executeOrdersBatch(org.knowm.xchange.bittrex.dto.batch.order.BatchOrder[]) throws java.io.IOException,public List<org.knowm.xchange.bittrex.dto.trade.BittrexOrder> getBittrexOpenOrders(org.knowm.xchange.service.trade.params.orders.OpenOrdersParams) throws java.io.IOException,public org.knowm.xchange.bittrex.dto.trade.BittrexOrder getBittrexOrder(java.lang.String) throws java.io.IOException,public org.knowm.xchange.bittrex.service.BittrexTradeServiceRaw.SequencedOpenOrders getBittrexSequencedOpenOrders(org.knowm.xchange.service.trade.params.orders.OpenOrdersParams) throws java.io.IOException,public List<org.knowm.xchange.bittrex.dto.trade.BittrexOrder> getBittrexUserTradeHistory(org.knowm.xchange.currency.CurrencyPair, java.util.Date, java.util.Date) throws java.io.IOException,public List<org.knowm.xchange.bittrex.dto.trade.BittrexOrder> getBittrexUserTradeHistory(org.knowm.xchange.currency.CurrencyPair) throws java.io.IOException,public List<org.knowm.xchange.bittrex.dto.trade.BittrexOrder> getBittrexUserTradeHistory() throws java.io.IOException,public java.lang.String placeBittrexLimitOrder(org.knowm.xchange.dto.trade.LimitOrder) throws java.io.IOException,public java.lang.String placeBittrexLimitOrder(org.knowm.xchange.dto.trade.LimitOrder, org.knowm.xchange.bittrex.dto.batch.order.neworder.TimeInForce) throws java.io.IOException,public java.lang.String placeBittrexMarketOrder(org.knowm.xchange.dto.trade.MarketOrder) throws java.io.IOException,public java.lang.String placeBittrexMarketOrder(org.knowm.xchange.dto.trade.MarketOrder, org.knowm.xchange.bittrex.dto.batch.order.neworder.TimeInForce) throws java.io.IOException<variables>