Package com.xeiam.xchange.btce.v2.dto.trade

Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCEPlaceOrderResult


  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BTCEMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BTCEAccountService(exchangeSpecification);
    this.pollingTradeService = new BTCETradeService(exchangeSpecification);
  }
View Full Code Here


    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BTCEMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BTCEAccountService(exchangeSpecification);
    this.pollingTradeService = new BTCETradeService(exchangeSpecification);
  }
View Full Code Here

  @Test
  public void testPlaceOrder() throws IOException {

    BTCEPlaceOrderReturn result = getResult("/v3/trade/example-place-order-data.json", BTCEPlaceOrderReturn.class);
    // Verify that the example data was unmarshalled correctly
    BTCEPlaceOrderResult rv = result.getReturnValue();
    Map<String, BigDecimal> funds = rv.getFunds();
    assertThat(funds.keySet().containsAll(Arrays.asList("btc", "nmc", "usd"))).isTrue();
    assertThat(funds.get("btc")).isEqualTo(new BigDecimal("2.498"));
    assertThat(rv.getOrderId()).isEqualTo(0L);
  }
View Full Code Here

    // place buy order
    BTCEOrder.Type type = BTCEOrder.Type.buy;
    String pair = "btc_usd";
    BTCEOrder btceOrder = new BTCEOrder(0, null, new BigDecimal("1"), new BigDecimal("0.1"), type, pair);

    BTCEPlaceOrderResult result = null;
    try {
      result = tradeService.placeBTCEOrder(btceOrder);
      System.out.println("placeBTCEOrder return value: " + result);

      printRawOpenOrders(tradeService);

      // Cancel the added order
      BTCECancelOrderResult cancelResult = tradeService.cancelBTCEOrder(result.getOrderId());
      System.out.println("Canceling returned " + cancelResult);
    } catch (ExchangeException e) {
      System.out.println(e.getMessage());
    }
View Full Code Here

    String pair = com.xeiam.xchange.btce.v3.BTCEUtils.getPair(limitOrder.getCurrencyPair());

    BTCEOrder btceOrder = new BTCEOrder(0, null, limitOrder.getLimitPrice(), limitOrder.getTradableAmount(), type, pair);

    BTCEPlaceOrderResult result = placeBTCEOrder(btceOrder);
    return Long.toString(result.getOrderId());
  }
View Full Code Here

    String pair = com.xeiam.xchange.btce.v3.BTCEUtils.getPair(limitOrder.getCurrencyPair());

    BTCEOrder btceOrder = new BTCEOrder(0, null, limitOrder.getLimitPrice(), limitOrder.getTradableAmount(), type, pair);

    BTCEPlaceOrderResult result = placeBTCEOrder(btceOrder);
    return Long.toString(result.getOrderId());
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btce.v2.dto.trade.BTCEPlaceOrderResult

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.