Class CobinhoodTradeService

All Implemented Interfaces:
BaseService, TradeService

public class CobinhoodTradeService
extends CobinhoodTradeServiceRaw
implements TradeService
  • Constructor Details

    • CobinhoodTradeService

      public CobinhoodTradeService​(Exchange exchange)
  • Method Details

    • placeLimitOrder

      public String placeLimitOrder​(LimitOrder limitOrder) throws IOException
      Description copied from interface: TradeService
      Place a limit order

      If your orders amount or limit price does to meet the restrictions dictated by CurrencyPairMetaData then the exchange will reject your order. Use OrderValuesHelper to validate and / or adjust those values while you'r building an order.

      Specified by:
      placeLimitOrder in interface TradeService
      Returns:
      the order ID
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
      See Also:
      OrderValuesHelper
    • cancelOrder

      public boolean cancelOrder​(String orderId) throws IOException
      Description copied from interface: TradeService
      cancels order with matching orderId (conveniance method, typical just delegate to cancelOrder(CancelOrderByIdParams))
      Specified by:
      cancelOrder in interface TradeService
      Returns:
      true if order was successfully cancelled, false otherwise.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getOrder

      public Collection<Order> getOrder​(String... orderIds) throws IOException
      Description copied from interface: TradeService
      get's the latest order form the order book that with matching orderId
      Specified by:
      getOrder in interface TradeService
      Returns:
      the order as it is on the exchange.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getOpenOrders

      public OpenOrders getOpenOrders() throws IOException
      Description copied from interface: TradeService
      Gets the open orders
      Specified by:
      getOpenOrders in interface TradeService
      Returns:
      the open orders, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getOpenOrders

      public OpenOrders getOpenOrders​(OpenOrdersParams params) throws IOException
      Description copied from interface: TradeService
      Gets the open orders
      Specified by:
      getOpenOrders in interface TradeService
      Parameters:
      params - The parameters describing the filter. Note that OpenOrdersParams is an empty interface. Exchanges should implement its own params object. Params should be create with TradeService.createOpenOrdersParams().
      Returns:
      the open orders, null if some sort of error occurred. Implementers should log the error.
      Throws:
      IOException - - Indication that a networking error occurred while fetching JSON data
    • getOpenOrders

      public OpenOrders getOpenOrders​(CurrencyPair pair) throws IOException
      Throws:
      IOException