public class CryptsyTradeService extends CryptsyTradeServiceRaw implements PollingTradeService
apiKey, cryptsy, cryptsyAuthenticated, signatureCreator
exchange
Constructor and Description |
---|
CryptsyTradeService(Exchange exchange)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelOrder(String orderId)
cancels order with matching orderId
|
TradeHistoryParams |
createTradeHistoryParams()
Create
TradeHistoryParams that supports TradeHistoryParamsTimeSpan . |
OpenOrders |
getOpenOrders()
Gets the open orders
|
UserTrades |
getTradeHistory(Object... arguments)
gets trade history for user's account
|
UserTrades |
getTradeHistory(TradeHistoryParams params)
Fetch the history of user trades.
|
String |
placeLimitOrder(LimitOrder limitOrder)
Place a limit order
|
String |
placeMarketOrder(MarketOrder marketOrder)
Place a market order
|
calculateCryptsyFees, cancelAllCryptsyLimitOrders, cancelMarketCryptsyLimitOrders, cancelSingleCryptsyLimitOrder, getCryptsyOpenOrders, getCryptsySingleMarketOpenOrders, getCryptsySingleMarketTradeHistory, getCryptsyTradeHistory, placeCryptsyLimitOrder
checkResult, getExchangeSymbols
verifyOrder, verifyOrder, verifyOrder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
verifyOrder, verifyOrder
getExchangeSymbols
public CryptsyTradeService(Exchange exchange)
exchange
- public OpenOrders getOpenOrders() throws IOException, ExchangeException
PollingTradeService
getOpenOrders
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON dataExchangeException
- - Indication that the exchange reported some kind of error with the request or responsepublic String placeMarketOrder(MarketOrder marketOrder) throws IOException, ExchangeException
PollingTradeService
placeMarketOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON dataExchangeException
- - Indication that the exchange reported some kind of error with the request or responsepublic String placeLimitOrder(LimitOrder limitOrder) throws IOException, ExchangeException
PollingTradeService
placeLimitOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON dataExchangeException
- - Indication that the exchange reported some kind of error with the request or responsepublic boolean cancelOrder(String orderId) throws IOException, ExchangeException
PollingTradeService
cancelOrder
in interface PollingTradeService
IOException
- - Indication that a networking error occurred while fetching JSON dataExchangeException
- - Indication that the exchange reported some kind of error with the request or responsepublic UserTrades getTradeHistory(Object... arguments) throws IOException, ExchangeException
PollingTradeService
getTradeHistory
in interface PollingTradeService
arguments
- Vararg list of optional (nullable) arguments: (Long) arguments[0] Number of transactions to return (String) arguments[1]
TradableIdentifier (String) arguments[2] TransactionCurrency (Long) arguments[3] Starting IDIOException
ExchangeException
- - Indication that the exchange reported some kind of error with the request or responsepublic UserTrades getTradeHistory(TradeHistoryParams params) throws IOException
PollingTradeService
PollingTradeService.createTradeHistoryParams()
and check which parameters are required or supported using instanceof operator. See subinterfaces of
TradeHistoryParams
. Note that whether an interface is required or supported will vary from exchange to exchange and it's described only
through the javadoc.
There is also implementation of all the common interfaces, TradeHistoryParamsAll
, that,
with all properties set non-null, should work with any exchange.
Some exchanges allow extra parameters, not covered by any common interface. To access them, you will have to use the object returned by
PollingTradeService.createTradeHistoryParams()
and cast it to the exchange-specific type.getTradeHistory
in interface PollingTradeService
params
- Can optionally implement TradeHistoryParamsTimeSpan
. All other TradeHistoryParams types will be ignored.IOException
- - Indication that a networking error occurred while fetching JSON dataPollingTradeService.getTradeHistory(Object...)
,
PollingTradeService.createTradeHistoryParams()
,
TradeHistoryParamsAll
public TradeHistoryParams createTradeHistoryParams()
TradeHistoryParams
that supports TradeHistoryParamsTimeSpan
.createTradeHistoryParams
in interface PollingTradeService
Copyright © 2012–2018 Xeiam, LLC. All rights reserved.