Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'T' in ccxt.bittrex in parse_ohlcv #523

Closed
stonemonk opened this issue Nov 9, 2017 · 5 comments
Closed

KeyError: 'T' in ccxt.bittrex in parse_ohlcv #523

stonemonk opened this issue Nov 9, 2017 · 5 comments
Assignees

Comments

@stonemonk
Copy link

stonemonk commented Nov 9, 2017

Calling bittrex_service.fetch_ohlcv("CANN/BTC", "1m") raised KeyError on line:

timestamp = self.parse8601(ohlcv['T'])

where:

{
'Ask': 0.00004935, 
'BaseVolume': 112.58089677, 
'Bid': 0.00004861, 
'Created': '2017-06-06T01:22:35.727', 
'High': 0.00005269, 
'Last': 0.00004854, 
'Low': 0.00004251, 
'MarketName': 'BTC-1ST', 
'OpenBuyOrders': 242, 
'OpenSellOrders': 5837, 
'PrevDay': 0.0000456, 
'TimeStamp': '2017-11-09T11:58:32.357', 
'Volume': 2370437.89533223
}

Note that MarketName is not the same as what was requested. The market dictionary OTOH, does reflect the correct market.

@kroitor
Copy link
Member

kroitor commented Nov 9, 2017

Thanks for reporting this, will take a look into it and get back to you.

@kroitor kroitor self-assigned this Nov 9, 2017
@kroitor
Copy link
Member

kroitor commented Nov 9, 2017

That's very strange... can't reproduce it on my side...

mbp:python igorkroitor$ python
Python 2.7.13 (default, Jun  5 2017, 10:04:07) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
>>> ccxt.bittrex().fetch_ohlcv('CANN/BTC', '1m')
[[1509373020000, 4e-06, 4e-06, 4e-06, 4e-06, 312.15402796], [1509373200000, 4e-06, 4.01e-06, 4e-06, 4.01e-06, 1147.69849854], [1509373320000, 4.01e-06, 4.01e-06, 4.01e-06, 4.01e-06, 256.32578615], [1509373500000, 4e-06, 4e-06, 4e-06, 4e-06, 5000.0], [1509373560000, 4e-06, 4e-06, 4e-06, 4e-06, 5000.0], [1509374040000, 4e-06, 4e-06, 4e-06, 4e-06, 574.7400873], [1509374100000, 4e-06, 4e-06, 4e-06, 4e-06, 3102.41075935], [1509374160000, 4.01e-06, 4.01e-06, 4e-06, 4e-06, 305.96590909], [1509374400000, 4.01e-06, 4.07e-06, 4.01e-06, 4.07e-06, 1161.74967859], [1509374520000, 4.07e-06, 4.07e-06, 4.07e-06, 4.07e-06, 2.34457914], [1509374640000, 4.07e-06, 4.07e-06, 4.07e-06, 4.07e-06, 200.0], [1509375000000, 4.07e-06, 4.07e-06, 4.07e-06, 4.07e-06, 198.770513], [1509375120000, 4.06e-06, 4.06e-06, 4.06e-06, 4.0

Can you show your full code and full output in verbose mode (set .verbose=True on the exchange instance or add {'verbose':True} to constructor)?

@stonemonk
Copy link
Author

I only saw it once and also haven't been able to reproduce again. I was basically calling that periodically in a loop for data collection, and it just popped up randomly. I'll run in verbose and in a debugger and see if I can catch it again (and debug)..

@kroitor
Copy link
Member

kroitor commented Nov 9, 2017

@stonemonk you might be hitting their rate limit if you do it more frequently than once per second, so, you might want to set .enableRateLimit = True or add {'enableRateLimit': True, 'verbose': True} to the constructor.

@kroitor
Copy link
Member

kroitor commented Nov 9, 2017

I would close this for now, if you don't mind, until we have further development on this issue. Feel free to reopen it or just continue posting if you experience problems with after setting a delay on bittrex. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants