Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created September 15, 2020 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyasugano/e55dfb2771454da3e96cf9edd7645547 to your computer and use it in GitHub Desktop.
Save yuyasugano/e55dfb2771454da3e96cf9edd7645547 to your computer and use it in GitHub Desktop.
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