Examples of CoinfloorOpenOrders


Examples of com.xeiam.xchange.coinfloor.dto.streaming.trade.CoinfloorOpenOrders

  public Map<String, Object> adaptOpenOrders(String data) throws ExchangeException {

    Map<String, Object> resultMap = new HashMap<String, Object>();

    CoinfloorOpenOrders rawRetObj;
    try {
      rawRetObj = streamObjectMapper.readValue(data, CoinfloorOpenOrders.class);
    } catch (IOException e) {
      throw new ExchangeException("JSON parse error", e);
    }
    resultMap.put("raw", rawRetObj);

    List<LimitOrder> openOrdersList = new ArrayList<LimitOrder>();
    List<CoinfloorOrder> orders = rawRetObj.getOrders();

    for (CoinfloorOrder order : orders) {
      openOrdersList.add(adaptOrder(order));
    }
View Full Code Here

Examples of com.xeiam.xchange.coinfloor.dto.streaming.trade.CoinfloorOpenOrders

    MarketOrder estMarketOrder = new MarketOrder(OrderType.ASK, new BigDecimal(1), new CurrencyPair("BTC", "GBP"));
    ((CoinfloorStreamingExchangeService) streamingExchangeService).estimateMarketOrder(estMarketOrder);
    TimeUnit.MILLISECONDS.sleep(1000);

    // get user's current open orders, cancel all of them.
    CoinfloorOpenOrders openOrders = (CoinfloorOpenOrders) ((CoinfloorStreamingExchangeService) streamingExchangeService).getOrders().getPayloadItem("raw");
    for (CoinfloorOrder order : openOrders.getOrders()) {
      ((CoinfloorStreamingExchangeService) streamingExchangeService).cancelOrder(order.getId());
      TimeUnit.MILLISECONDS.sleep(1000);
    }

    // unsubscribe to ticker feed
View Full Code Here

Examples of com.xeiam.xchange.coinfloor.dto.streaming.trade.CoinfloorOpenOrders

    for (Thread t : threads) {
      t.join();
    }

    // get user's current open orders, cancel all of them.
    CoinfloorOpenOrders openOrders = (CoinfloorOpenOrders) ((CoinfloorStreamingExchangeService) streamingExchangeService).getOrders().getPayloadItem("raw");
    for (CoinfloorOrder order : openOrders.getOrders()) {
      resultMap = ((CoinfloorStreamingExchangeService) streamingExchangeService).cancelOrder(order.getId()).getPayload();
      System.out.println("\n\n\n\n\nCancelled order: ");
      System.out.println("Raw Object: " + resultMap.get("raw"));
      System.out.println("Generic Object: " + resultMap.get("generic"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.