Package com.xeiam.xchange.dto.trade

Examples of com.xeiam.xchange.dto.trade.OpenOrders


    printOpenOrders();
  }

  private static OpenOrders printOpenOrders() throws IOException {

    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders.toString());
    return openOrders;
  }
View Full Code Here


    BTCChinaGetOrdersResponse withdetail = tradeServiceRaw.getBTCChinaOrders(Boolean.FALSE, BTCChinaExchange.DEFAULT_MARKET, null, null, null, Boolean.TRUE);
    System.out.println(withdetail);

    // Generic
    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders);
  }
View Full Code Here

    String orderID = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order ID: " + orderID);

    // get open orders
    OpenOrders openOrders = tradeService.getOpenOrders();
    for (LimitOrder openOrder : openOrders.getOpenOrders()) {
      System.out.println(openOrder.toString());
    }

  }
View Full Code Here

    boolean success = tradeService.cancelOrder("5aaef0f5-8c90-4a93-a097-0bad2dd475c5");
    System.out.println("success= " + success);

    // get open orders
    OpenOrders openOrders = tradeService.getOpenOrders();
    for (LimitOrder openOrder : openOrders.getOpenOrders()) {
      System.out.println(openOrder.toString());
    }
  }
View Full Code Here

    // Interested in the private trading functionality (authentication)
    PollingTradeService tradeService = anx.getPollingTradeService();

    // Get the open orders
    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders.toString());
  }
View Full Code Here

      OrderType orderType = bitstampOrder.getType() == 0 ? OrderType.BID : OrderType.ASK;
      String id = Integer.toString(bitstampOrder.getId());
      BigDecimal price = bitstampOrder.getPrice();
      limitOrders.add(new LimitOrder(orderType, bitstampOrder.getAmount(), CurrencyPair.BTC_USD, id, bitstampOrder.getTime(), price));
    }
    return new OpenOrders(limitOrders);
  }
View Full Code Here

  @Test
  public void testAdaptOpenOrders() throws IOException {

    BTCTradeOrder[] btcTradeOrders = mapper.readValue(getClass().getResource("dto/trade/orders-open.json"), BTCTradeOrder[].class);

    OpenOrders openOrders = BTCTradeAdapters.adaptOpenOrders(btcTradeOrders);
    List<LimitOrder> openOrderList = openOrders.getOpenOrders();
    assertEquals(2, openOrderList.size());

    LimitOrder order = openOrderList.get(0);
    assertEquals(CurrencyPair.LTC_CNY, order.getCurrencyPair());
    assertEquals("16636810", order.getId());
View Full Code Here

      Date timestamp = DateUtils.fromMillisUtc(bTCEOrder.getTimestampCreated() * 1000L);
      CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());

      limitOrders.add(new LimitOrder(orderType, bTCEOrder.getAmount(), currencyPair, Long.toString(id), timestamp, price));
    }
    return new OpenOrders(limitOrders);
  }
View Full Code Here

      Date timestamp = DateUtils.fromMillisUtc(bTCEOrder.getTimestampCreated() * 1000L);
      CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());

      limitOrders.add(new LimitOrder(orderType, bTCEOrder.getAmount(), currencyPair, Long.toString(id), timestamp, price));
    }
    return new OpenOrders(limitOrders);
  }
View Full Code Here

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CryptsyOpenOrdersReturn cryptsyOpenOrders = mapper.readValue(is, CryptsyOpenOrdersReturn.class);

    OpenOrders adaptedOpenOrders = CryptsyAdapters.adaptOpenOrders(cryptsyOpenOrders);

    assertEquals(adaptedOpenOrders.getOpenOrders().size(), 9);

    LimitOrder order = adaptedOpenOrders.getOpenOrders().get(0);
    assertEquals(order.getId(), "90039904");
    assertEquals(order.getLimitPrice(), new BigDecimal("0.00000001"));
    assertEquals(order.getTradableAmount(), new BigDecimal("50000.10000000"));
    assertEquals(order.getCurrencyPair().baseSymbol, "WDC");
    assertEquals(order.getCurrencyPair().counterSymbol, "BTC");
    assertEquals(order.getType(), OrderType.BID);

    LimitOrder order2 = adaptedOpenOrders.getOpenOrders().get(8);
    assertEquals(order2.getId(), "90041288");
    assertEquals(order2.getLimitPrice(), new BigDecimal("0.00000009"));
    assertEquals(order2.getTradableAmount(), new BigDecimal("50001.00000000"));
    assertEquals(order2.getCurrencyPair().baseSymbol, "LTC");
    assertEquals(order2.getCurrencyPair().counterSymbol, "BTC");
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.trade.OpenOrders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.