Package com.xeiam.xchange.btcchina.dto.trade

Examples of com.xeiam.xchange.btcchina.dto.trade.BTCChinaOrder


    assertEquals(new BigDecimal("5.00000000"), io.getDisclosedAmount());
    assertEquals(new BigDecimal("0.10"), io.getVariance());
    assertEquals(1405412126L, io.getDate());
    assertEquals("open", io.getStatus());

    BTCChinaOrder o = io.getOrders()[0];
    assertEquals(3301L, o.getId());
    assertEquals("bid", o.getType());
    assertEquals(new BigDecimal("40.00"), o.getPrice());
    assertEquals("CNY", o.getCurrency());
    assertEquals(new BigDecimal("4.67700000"), o.getAmount());
    assertEquals(new BigDecimal("4.67700000"), o.getAmountOriginal());
    assertEquals(1405412126L, o.getDate());
    assertEquals("open", o.getStatus());
  }
View Full Code Here


  @Test
  public void testBTCChinaGetOrderResponse() throws IOException {

    BTCChinaGetOrderResponse response = mapper.readValue(getClass().getResource("getOrder.json"), BTCChinaGetOrderResponse.class);
    BTCChinaOrder order = response.getResult().getOrder();
    assertOrder(order);
    assertNull(order.getDetails());
  }
View Full Code Here

  @Test
  public void testBTCChinaGetOrderResponseWithdetail() throws IOException {

    BTCChinaGetOrderResponse response = mapper.readValue(getClass().getResource("getOrder-withdetail.json"), BTCChinaGetOrderResponse.class);
    BTCChinaOrder order = response.getResult().getOrder();
    assertOrder(order);
    assertEquals(1403170822L, order.getDetails()[0].getDateline());
    assertEquals(new BigDecimal("3811.69"), order.getDetails()[0].getPrice());
    assertEquals(new BigDecimal("0.031"), order.getDetails()[0].getAmount());
  }
View Full Code Here

    else {
      response = tradeServiceRaw.getBTCChinaOrder(orderId, market, withdetail);
    }
    System.out.println(response);

    BTCChinaOrder order = response.getResult().getOrder();
    System.out.println("OrderID:\t" + order.getId());
    System.out.println("Side:\t" + order.getType());
    System.out.println("Price:\t" + order.getPrice());
    System.out.println("Currency: \t" + order.getCurrency());
    System.out.println("LeavesQty:\t" + order.getAmount());
    System.out.println("OrderQty:\t" + order.getAmountOriginal());
    System.out.println("CumQty:\t" + order.getAmountOriginal().subtract(order.getAmount()));
    System.out.println("Date:\t" + new Date(order.getDate() * 1000));
    System.out.println("Status:\t" + order.getStatus());
    if (order.getDetails() != null) {
      for (BTCChinaOrderDetail detail : order.getDetails()) {
        System.out.println("--");
        System.out.println("dateline:\t" + detail.getDateline());
        System.out.println("price:\t" + detail.getPrice());
        System.out.println("amount:\t" + detail.getAmount());
      }
View Full Code Here

    Thread.sleep(1500);
    BTCChinaResponse<BTCChinaOrders> openOrders = printOpenOrdersRaw();

    long result = -1;
    for (int i = 0; i < openOrders.getResult().getOrders().size(); i++) {
      BTCChinaOrder order = openOrders.getResult().getOrders().get(i);
      int orderId = order.getId();
      if (order.getType().equals(limitOrder.getType().toString()) && order.getPrice().compareTo(limitOrder.getLimitPrice()) == 0 && orderId > result) {
        result = orderId;
      }
    }

    // Cancel the added order
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btcchina.dto.trade.BTCChinaOrder

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.