You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ExchangeHuobiAPI.OnGetTickersAsync() - System.ArgumentException: 'Accessed JArray values with invalid key value: "data". Int32 array index expected.' #421
Yes, like you said, would work for only a single ticker not multiple. So we would have to loop through and call it multiple times if ppl wanted multiple tickers
Activity
GonzoKK commentedon Aug 19, 2019
I'll have a stab at troubleshooting this...
Firstly I removed "data" as its not there for this endpoint (see below)
Note that askKey and bidKey are hardcoded as null - which causes ParseTicker to crash on line 441
https://api.huobi.pro/market/tickers
https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
This endpoint (for multiple tickers) returns:
"open": 0.429192,
"close": 0.43193,
"low": 0.42868,
"high": 0.444504,
"amount": 805.14014476611283,
"count": 2644,
"vol": 349.6994085636,
"symbol": "xmreth"
Bid and Ask are not there, which means ParseTicker will fail.
Looks like the code would only work for a single ticker eg
https://api.huobi.pro/market/detail/merged?symbol=ethusdt
but not for multiple tickers...
A hack would be to test for null, but that means the ExchangeTicker would be not be populated with Ask and Bid.
Any thoughts?
vslee commentedon Aug 19, 2019
Might have to switch to get aggregated tickers endpoint bc that has bid/ask.
GET https://api.huobi.pro/market/detail/merged
vslee commentedon Aug 19, 2019
Yes, like you said, would work for only a single ticker not multiple. So we would have to loop through and call it multiple times if ppl wanted multiple tickers
GonzoKK commentedon Aug 20, 2019
Testing further... I changed askKey to "ask" and bidKey to "bid"
This however leads to a parsing error for symbol "hb10":
"symbol": "hb10",
"open": 0.6076,
"close": 0.608,
"low": 0.6009,
"high": 0.6147,
"amount": 0.0,
"count": 0,
"vol": 0.0
Seems the problem lies with api.ExchangeMarketSymbolToCurrencies(marketSymbol);
I reckon the symbol parsing logic can/should be improved
vslee commentedon Aug 20, 2019
What does hb10 refer to? Is that the name of a symbol?
GonzoKK commentedon Aug 21, 2019
See #424 (comment)
GonzoKK commentedon Sep 4, 2019
See potential fix at #424 (comment)
jjxtra commentedon Sep 5, 2019
Fixed in latest master