use of org.knowm.xchange.dto.trade.MarketOrder 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.MarketOrder 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.MarketOrder in project XChange by knowm.
the class TradeServiceIntegrationTransactionsCreateOrder method createMarketOrder.
private static void createMarketOrder() throws IOException {
String apiKey = "00af0b38-11fb-4aab-bf19-45edd44a4adc";
String secretKey = "fa3f0510-155f-4567-a3b3-3f386080efa3";
Exchange coinsuper = ExchangeFactory.INSTANCE.createExchange(CoinsuperExchange.class);
ExchangeSpecification exchangeSpecification = coinsuper.getExchangeSpecification();
exchangeSpecification.setApiKey(apiKey);
exchangeSpecification.setSecretKey(secretKey);
coinsuper.applySpecification(exchangeSpecification);
TradeService tradeService = coinsuper.getTradeService();
try {
// place a limit buy order
MarketOrder marketOrder = new MarketOrder((OrderType.BID), new BigDecimal("30513299.8408"), CurrencyPair.XRP_BTC, null, null, null, null, null, null);
String result = tradeService.placeMarketOrder(marketOrder);
System.out.println("createMarketOrder return value: " + result);
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.knowm.xchange.dto.trade.MarketOrder in project XChange by knowm.
the class PlaceMarketOrderDemo method generic.
private static void generic(TradeService tradeService) throws IOException {
// place a limit buy order
MarketOrder marketOrder = new MarketOrder((OrderType.ASK), new BigDecimal(".1"), CurrencyPair.BTC_USD);
String marketOrderReturnValue = tradeService.placeMarketOrder(marketOrder);
System.out.println("Market Order return value: " + marketOrderReturnValue);
}
use of org.knowm.xchange.dto.trade.MarketOrder in project XChange by knowm.
the class LgoStreamingExchangeExample method placeMarketOrder.
@Test
public void placeMarketOrder() throws IOException {
String ref = exchange.getStreamingTradeService().placeMarketOrder(new MarketOrder(Order.OrderType.ASK, new BigDecimal("0.5"), CurrencyPair.BTC_USD, null, new Date()));
System.out.println("Order was placed with reference: " + ref);
}
Aggregations