Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ccxt library in Python to fetch OHLCV data
#!/usr/bin/python
import ccxt
import time
binance = ccxt.binance()
if binance.has['fetchOHLCV']:
for symbol in binance.load_markets():
time.sleep (binance.rateLimit / 1000) # time.sleep wants seconds
print(symbol, binance.fetch_ohlcv(symbol, '1d')) # one day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment