use of org.knowm.xchange.dto.trade.LimitOrder in project XChange by knowm.
the class KrakenLimitOrderDemo method generic.
private static void generic(Exchange krakenExchange) throws IOException {
TradeService tradeService = krakenExchange.getTradeService();
OrderType orderType = (OrderType.ASK);
BigDecimal tradeableAmount = new BigDecimal("0.01");
BigDecimal price = new BigDecimal("65.25");
LimitOrder limitOrder = new LimitOrder(orderType, tradeableAmount, CurrencyPair.BTC_LTC, "", null, price);
String orderID = tradeService.placeLimitOrder(limitOrder);
System.out.println("Limit Order ID: " + orderID);
}
use of org.knowm.xchange.dto.trade.LimitOrder in project XChange by knowm.
the class LakeBTCBuyOrderDemo method raw.
private static void raw(Exchange lakeBtcExchange) throws IOException {
LakeBTCTradeServiceRaw tradeService = (LakeBTCTradeServiceRaw) lakeBtcExchange.getTradeService();
System.out.println("Open Orders: " + Arrays.toString(tradeService.getLakeBTCOrders()));
// place a limit buy order
LimitOrder limitOrder = new LimitOrder((Order.OrderType.BID), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));
LakeBTCOrderResponse limitOrderReturnValue = tradeService.placeLakeBTCLimitOrder(limitOrder);
System.out.println("Limit Order return value: " + limitOrderReturnValue);
// place a market buy order
MarketOrder marketOrder = new MarketOrder((Order.OrderType.BID), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null);
LakeBTCOrderResponse marketOrderReturnValue = tradeService.placeLakeBTCMarketOrder(marketOrder);
System.out.println("Market Order return value: " + marketOrderReturnValue);
System.out.println("Open Orders: " + Arrays.toString(tradeService.getLakeBTCOrders()));
}
use of org.knowm.xchange.dto.trade.LimitOrder in project XChange by knowm.
the class LakeBTCBuyOrderDemo method generic.
private static void generic(Exchange lakebtcExchange) throws IOException {
TradeService tradeService = lakebtcExchange.getTradeService();
System.out.println("Open Orders: " + tradeService.getOpenOrders());
// place a limit buy order
LimitOrder limitOrder = new LimitOrder((Order.OrderType.BID), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));
String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
System.out.println("Limit Order return value: " + limitOrderReturnValue);
// place a market buy order
MarketOrder marketOrder = new MarketOrder((Order.OrderType.BID), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null);
String marketOrderReturnValue = tradeService.placeMarketOrder(marketOrder);
System.out.println("Limit Order return value: " + marketOrderReturnValue);
System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());
}
use of org.knowm.xchange.dto.trade.LimitOrder in project XChange by knowm.
the class LakeBTCCancelOrderDemo method generic.
private static void generic(Exchange lakebtcExchange) throws IOException {
TradeService tradeService = lakebtcExchange.getTradeService();
System.out.println("Open Orders: " + tradeService.getOpenOrders());
// place a limit buy order
LimitOrder limitOrder = new LimitOrder((Order.OrderType.ASK), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));
String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
System.out.println("Limit Order return value: " + limitOrderReturnValue);
System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());
// Cancel the added order
boolean cancelResult = tradeService.cancelOrder(limitOrderReturnValue);
System.out.println("Canceling returned " + cancelResult);
System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());
}
use of org.knowm.xchange.dto.trade.LimitOrder in project XChange by knowm.
the class LakeBTCSellOrderDemo method raw.
private static void raw(Exchange lakeBtcExchange) throws IOException {
LakeBTCTradeServiceRaw tradeService = (LakeBTCTradeServiceRaw) lakeBtcExchange.getTradeService();
System.out.println("Open Orders: " + Arrays.toString(tradeService.getLakeBTCOrders()));
// place a limit buy order
LimitOrder limitOrder = new LimitOrder((Order.OrderType.ASK), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));
LakeBTCOrderResponse limitOrderReturnValue = tradeService.placeLakeBTCLimitOrder(limitOrder);
System.out.println("Limit Order return value: " + limitOrderReturnValue);
System.out.println("Open Orders: " + Arrays.toString(tradeService.getLakeBTCOrders()));
}
Aggregations