Search in sources :

Example 1 with CoinfloorMarketOrderResponse

use of org.knowm.xchange.coinfloor.dto.trade.CoinfloorMarketOrderResponse in project XChange by knowm.

the class CoinfloorPlaceMarketOrderIntegration method placeMarketOrderTest.

@Test
public void placeMarketOrderTest() throws IOException {
    final ExchangeSpecification specification = new ExchangeSpecification(CoinfloorExchange.class);
    String username = System.getProperty("xchange.coinfloor.username");
    String password = System.getProperty("xchange.coinfloor.password");
    if (username == null || password == null) {
        return;
    }
    specification.setUserName(username);
    specification.setPassword(password);
    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(specification);
    CoinfloorTradeServiceRaw rawService = (CoinfloorTradeServiceRaw) exchange.getTradeService();
    CoinfloorMarketOrderResponse order = rawService.placeMarketOrder(CurrencyPair.BTC_EUR, OrderType.ASK, new BigDecimal("0.0001"));
    logger.info("placed market order with remainingQty={}", order.getRemaining());
}
Also used : CoinfloorExchange(org.knowm.xchange.coinfloor.CoinfloorExchange) Exchange(org.knowm.xchange.Exchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) CoinfloorMarketOrderResponse(org.knowm.xchange.coinfloor.dto.trade.CoinfloorMarketOrderResponse) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Aggregations

BigDecimal (java.math.BigDecimal)1 Test (org.junit.Test)1 Exchange (org.knowm.xchange.Exchange)1 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)1 CoinfloorExchange (org.knowm.xchange.coinfloor.CoinfloorExchange)1 CoinfloorMarketOrderResponse (org.knowm.xchange.coinfloor.dto.trade.CoinfloorMarketOrderResponse)1