Open nickmitchko opened 4 years ago
I found a workaround which required populating the KrakenUtils pair map prior to calling the OHLC function:
KrakenExchange exchange = (KrakenExchange) ExchangeFactory.INSTANCE.createExchange(Credentials.getInstance().getNewExchangeSpec());
KrakenMarketDataService dataService = (KrakenMarketDataService) exchange.getMarketDataService();
// Required below to call OHLC
try {
KrakenAssets assets = dataService.getKrakenAssets();
KrakenUtils.setKrakenAssets(assets.getAssetPairMap());
KrakenAssetPairs krakenAssetPairs = dataService.getKrakenAssetPairs();
KrakenUtils.setKrakenAssetPairs(krakenAssetPairs.getAssetPairMap());
System.out.println("");
} catch (IOException ioException) {
ioException.printStackTrace();
}
// Call OHLC below this works.
// ...
KrakenOHLCs krakenOHLC = dataService.getKrakenOHLC(CurrencyPair.BTC_USD, 1, (Long)null);
krakenOHLC.getOHLCs();
Maybe this sort of pair initialization should go into the kraken lib, who is the maintainer of that?
The Kraken OHLC api does not seem to be properly implementing the KrakenCurrencyPair array.
I am running this code and the exchange works for all other purposes:
When I debug, it seems that the OHLC call is providing a null
CurrencyPair
string to the actual API call.See here for the bugger when I use both
CurrencyPair.BTC_USD
andCurrencyPair.XBT_USD
It seems the call to
KrakenUtils.createKrakenCurrencyPair()
returns an error always due to a bug in KrakenUtils