com.xeiam.xchange.examples.bitfinex.trade.BitfinexTradeDemo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-examples Show documentation
Show all versions of xchange-examples Show documentation
Provides a set of examples that demonstrate how to use XChange in client applications
The newest version!
package com.xeiam.xchange.examples.bitfinex.trade;
import java.io.IOException;
import java.math.BigDecimal;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.bitfinex.v1.BitfinexOrderType;
import com.xeiam.xchange.bitfinex.v1.service.polling.BitfinexTradeServiceRaw;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.dto.Order.OrderType;
import com.xeiam.xchange.dto.trade.LimitOrder;
import com.xeiam.xchange.examples.bitfinex.BitfinexDemoUtils;
public class BitfinexTradeDemo {
public static void main(String[] args) throws IOException {
Exchange bfx = BitfinexDemoUtils.createExchange();
raw(bfx);
}
private static void raw(Exchange bfx) throws IOException {
BitfinexTradeServiceRaw tradeService = (BitfinexTradeServiceRaw) bfx.getPollingTradeService();
LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("481.69"))
.tradableAmount(new BigDecimal("0.001")).build();
tradeService.placeBitfinexLimitOrder(limitOrder, BitfinexOrderType.LIMIT, false);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy