Package com.xeiam.xchange.dto.trade

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


  private static void generic(PollingTradeService tradeService) throws IOException {

    printOpenOrders(tradeService);

    // place a limit buy order
    LimitOrder limitOrder = new LimitOrder((OrderType.ASK), new BigDecimal(".001"), CurrencyPair.BTC_USD, "", null, new BigDecimal("1000.00"));
    String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order return value: " + limitOrderReturnValue);

    printOpenOrders(tradeService);
View Full Code Here


    PollingTradeService tradeService = exchange.getPollingTradeService();

    printOpenOrders(tradeService);

    // place a limit buy order
    LimitOrder limitOrder = new LimitOrder(Order.OrderType.ASK, new BigDecimal("0.1"), CurrencyPair.BTC_USD, "", null, new BigDecimal("1023.45"));

    String limitOrderReturnValue = null;
    try {
      limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
      System.out.println("Limit Order return value: " + limitOrderReturnValue);
View Full Code Here

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

    Thread.sleep(4000);

    LimitOrder limitOrder = new LimitOrder(OrderType.ASK, new BigDecimal(".01"), CurrencyPair.BTC_USD, null, null, new BigDecimal("1000.00"));
    String orderId = tradeService.placeLimitOrder(limitOrder);
    System.out.println(orderId);

    Thread.sleep(4000);
View Full Code Here

    CryptoTradeOrders orders = tradeService.getCryptoTradeOrderHistory(params);
    System.out.println(orders);

    Thread.sleep(4000);

    LimitOrder limitOrder = new LimitOrder(OrderType.ASK, new BigDecimal(".01"), CurrencyPair.BTC_USD, null, null, new BigDecimal("1000.00"));
    CryptoTradePlaceOrderReturn orderReturn = tradeService.placeCryptoTradeLimitOrder(limitOrder);
    System.out.println(orderReturn);

    Thread.sleep(4000);

    orders = tradeService.getCryptoTradeOrderHistory(params);
    System.out.println(orders);

    Thread.sleep(4000);

    long orderId = Long.valueOf(limitOrder.getId());
    CryptoTradeOrderInfoReturn orderInfo = tradeService.getCryptoTradeOrderInfo(orderId);
    CryptoTradeOrder cryptoOrder = orderInfo.getOrder();
    System.out.println(cryptoOrder);

    Thread.sleep(4000);
View Full Code Here

  }

  private static void generic(PollingTradeService tradeService) throws IOException {

    CurrencyPair pair = new CurrencyPair("ZET", "BTC");
    LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, pair).limitPrice(new BigDecimal("0.00001000")).tradableAmount(new BigDecimal("100")).build();

    try {
      String uuid = tradeService.placeLimitOrder(limitOrder);
      System.out.println("Order successfully placed. ID=" + uuid);
View Full Code Here

  }

  private static void raw(BittrexTradeServiceRaw tradeService) throws IOException {

    CurrencyPair pair = new CurrencyPair("ZET", "BTC");
    LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, pair).limitPrice(new BigDecimal("0.00001000")).tradableAmount(new BigDecimal("100")).build();

    try {
      String uuid = tradeService.placeBittrexLimitOrder(limitOrder);
      System.out.println("Order successfully placed. ID=" + uuid);
View Full Code Here

  }

  public static LimitOrder adaptOrder(BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, OrderType orderType, String id) {

    // place a limit order
    return new LimitOrder(orderType, amount, currencyPair, "", null, price);
  }
View Full Code Here

        timeStamp = vircurexDateFormat.parse(vircurexOpenOrder.getReleaseDate());
      } catch (ParseException e) {
        timeStamp = null;
      }

      adaptedOrders.add(new LimitOrder(orderType, BigDecimal.ONE, new CurrencyPair(vircurexOpenOrder.getBaseCurrency(), vircurexOpenOrder.getCounterCurrency()), vircurexOpenOrder.getOrderId(),
          timeStamp, vircurexOpenOrder.getUnitPrice()));
    }

    return adaptedOrders;
  }
View Full Code Here

    return orders;
  }

  public static LimitOrder adaptOrder(final CurrencyPair currencyPair, final OrderType orderType, final MintPalPublicOrder mintPalOrder) {

    return new LimitOrder(orderType, mintPalOrder.getAmount(), currencyPair, null, null, mintPalOrder.getPrice());
  }
View Full Code Here

  public static void generic() throws IOException, InterruptedException {

    printOpenOrders();

    // place a limit buy order
    LimitOrder limitOrder = new LimitOrder((OrderType.BID), BigDecimal.ONE, CurrencyPair.BTC_CNY, "", null, new BigDecimal("0.01"));
    String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order return value: " + limitOrderReturnValue);

    Thread.sleep(1500);
    OpenOrders openOrders = printOpenOrders();

    long result = -1;
    for (LimitOrder order : openOrders.getOpenOrders()) {
      long orderId = Long.parseLong(order.getId());
      if (order.getType().equals(limitOrder.getType().toString()) && order.getLimitPrice().compareTo(limitOrder.getLimitPrice()) == 0 && orderId > result) {

        result = orderId;
      }
    }
View Full Code Here

TOP

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

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.