Created
September 15, 2020 04:06
-
-
Save yuyasugano/e55dfb2771454da3e96cf9edd7645547 to your computer and use it in GitHub Desktop.
ccxt library in Python to fetch OHLCV data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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