question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

okex fetch_ohlcv symbol error in latest version

See original GitHub issue
  • OS: mac/ubuntu 16.04
  • Programming Language version: python
  • CCXT version: latest
  • Exchange: okex
  • Method: fetch_ohlcv()
okex = ccxt.okex({
    'apiKey': '',
    'secret': '',
})

result = okex.fetch_ohlcv('ETH/USD', 1561708800000, None, '15m', {'contract_type': 'this_week'})

The above code works for 1.18.478, but throws error for 1.18.859

Traceback (most recent call last):
  File "test_okex.py", line 10, in <module>
    result = okex.fetch_ohlcv('ETH/USD', since=1561708800000, timeframe='15m', params={'contract_type': 'this_week'})
  File "/home/ubuntu/.pyenv/versions/bricks/lib/python3.6/site-packages/ccxt/okcoinusd.py", line 700, in fetch_ohlcv
    market = self.market(symbol)
  File "/home/ubuntu/.pyenv/versions/bricks/lib/python3.6/site-packages/ccxt/base/exchange.py", line 1573, in market
    self.raise_error(ExchangeError, details='No market symbol ' + str(symbol))
  File "/home/ubuntu/.pyenv/versions/bricks/lib/python3.6/site-packages/ccxt/base/exchange.py", line 443, in raise_error
    raise exception_type(output)
ccxt.base.errors.ExchangeError: okex No market symbol ETH/USD

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kroitorcommented, Jul 1, 2019

You have to use their proper futures markets symbols (they have been changed since 1.18.478):

# mbp:python igorkroitor$ python3
# Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43)
# [Clang 6.0 (clang-600.0.57)] on darwin
# Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
>>> exchange = ccxt.okex()
>>> markets = exchange.load_markets()
>>> pprint([symbol for symbol in exchange.symbols if 'ETH' in symbol and 'USD' in symbol ])
['ETH-USD-190705', 'ETH-USD-190712', 'ETH-USD-190927', 'ETH/USDK', 'ETH/USDT']
# ↑ you need this  or this ↑  or this        ↑
1reaction
yurenjicommented, Jul 1, 2019

tested with 1.18.860 , works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exchanges — ccxt 2.4.71 documentation
version : A string literal containing version identifier for current exchange ... array of timeframes, supported by the fetchOHLCV method of the exchange....
Read more >
Download Historical Data of All Cryptocoins with CCXT for free
In my previous post, I explained how to download historical data for Binance coins. The good news is that it is also possible...
Read more >
ccxt Documentation - Read the Docs
A JavaScript / Python / PHP library for cryptocurrency trading and e-commerce with support for many bit- coin/ether/altcoin exchange markets ...
Read more >
Error when fetch ohlcv - Binance Developer Community
Hi everyone, Im having an error when fetching ohlcv when connect to binance api. But when i comment api, it work without any...
Read more >
Newest 'ccxt' Questions - Stack Overflow
Error Code: 4061 While Executing Hedge Mode Order In Binance CCXT python ... OS: Mac OS IDE: VSCode Pandas version: 1.4.2 I am...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found