This commit is contained in:
Dobromir Popov
2024-06-12 15:46:47 +03:00
parent 9b739fa128
commit fa6e59d3ae
4 changed files with 221 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import ccxt
import pandas as pd
exchange = ccxt.coinbase()
symbol = 'BTC/USDT'
timeframe = '1m'
ohlcv = exchange.fetch_ohlcv(symbol, timeframe)
df = pd.DataFrame(ohlcv, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
df.set_index('timestamp', inplace=True)
# print(df.head())
print(df)