class TradeDemo {

  public static void main(String[] args) throws IOException {

    Exchange exchange = CexIODemoUtils.createExchange();
    TradeService tradeService = exchange.getTradeService();

    generic(tradeService);
    raw((CexIOTradeServiceRaw) tradeService);
  }

  private static void generic(TradeService tradeService)
      throws NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {<FILL_FUNCTION_BODY>}

  private static void raw(CexIOTradeServiceRaw tradeService) throws IOException {

    List<CexIOOrder> openOrders = tradeService.getCexIOOpenOrders(new CurrencyPair("NMC", "BTC"));
    System.out.println(openOrders);
  }

  private static void printOpenOrders(TradeService tradeService) throws IOException {

    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders.toString());
  }
}


    printOpenOrders(tradeService);

    // place a limit buy order
    LimitOrder limitOrder =
        new LimitOrder(
            Order.OrderType.BID,
            BigDecimal.ONE,
            new CurrencyPair(Currency.GHs, Currency.BTC),
            "",
            null,
            new BigDecimal("0.00015600"));
    System.out.println("Trying to place: " + limitOrder);
    String orderId = "0";
    try {
      orderId = tradeService.placeLimitOrder(limitOrder);
      System.out.println("New Limit Order ID: " + orderId);
    } catch (ExchangeException e) {
      System.out.println(e);
    }
    printOpenOrders(tradeService);

    // Cancel the added order
    boolean cancelResult = tradeService.cancelOrder(orderId);
    System.out.println("Canceling order id=" + orderId + " returned " + cancelResult);

    printOpenOrders(tradeService);
  
<no_super_class>