Search in sources :

Example 1 with LakeBTCTradeServiceRaw

use of org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw 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()));
}
Also used : LakeBTCTradeServiceRaw(org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw) MarketOrder(org.knowm.xchange.dto.trade.MarketOrder) LimitOrder(org.knowm.xchange.dto.trade.LimitOrder) BigDecimal(java.math.BigDecimal) LakeBTCOrderResponse(org.knowm.xchange.lakebtc.dto.trade.LakeBTCOrderResponse)

Example 2 with LakeBTCTradeServiceRaw

use of org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw 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()));
}
Also used : LakeBTCTradeServiceRaw(org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw) LimitOrder(org.knowm.xchange.dto.trade.LimitOrder) BigDecimal(java.math.BigDecimal) LakeBTCOrderResponse(org.knowm.xchange.lakebtc.dto.trade.LakeBTCOrderResponse)

Example 3 with LakeBTCTradeServiceRaw

use of org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw in project XChange by knowm.

the class LakeBTCTradeHistoryDemo method raw.

private static void raw(Exchange lakeBtcExchange) throws IOException {
    LakeBTCTradeServiceRaw tradeService = (LakeBTCTradeServiceRaw) lakeBtcExchange.getTradeService();
    // Get the trade history
    LakeBTCTradeResponse[] trades = tradeService.getLakeBTCTradeHistory(0);
    System.out.println(Arrays.toString(trades));
}
Also used : LakeBTCTradeResponse(org.knowm.xchange.lakebtc.dto.trade.LakeBTCTradeResponse) LakeBTCTradeServiceRaw(org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw)

Example 4 with LakeBTCTradeServiceRaw

use of org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw in project XChange by knowm.

the class LakeBTCCancelOrderDemo 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);
    // Cancel the added order
    LakeBTCCancelResponse cancelResult = tradeService.cancelLakeBTCOrder(limitOrderReturnValue.getId());
    System.out.println("Canceling returned " + cancelResult.getResult());
}
Also used : LakeBTCTradeServiceRaw(org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw) LakeBTCCancelResponse(org.knowm.xchange.lakebtc.dto.trade.LakeBTCCancelResponse) LimitOrder(org.knowm.xchange.dto.trade.LimitOrder) BigDecimal(java.math.BigDecimal) LakeBTCOrderResponse(org.knowm.xchange.lakebtc.dto.trade.LakeBTCOrderResponse)

Aggregations

LakeBTCTradeServiceRaw (org.knowm.xchange.lakebtc.service.LakeBTCTradeServiceRaw)4 BigDecimal (java.math.BigDecimal)3 LimitOrder (org.knowm.xchange.dto.trade.LimitOrder)3 LakeBTCOrderResponse (org.knowm.xchange.lakebtc.dto.trade.LakeBTCOrderResponse)3 MarketOrder (org.knowm.xchange.dto.trade.MarketOrder)1 LakeBTCCancelResponse (org.knowm.xchange.lakebtc.dto.trade.LakeBTCCancelResponse)1 LakeBTCTradeResponse (org.knowm.xchange.lakebtc.dto.trade.LakeBTCTradeResponse)1