我想获得BTCUSD的移动平均线。我试图获取前20天的数据,但是我收到了一个限制错误。是否有可能使用btfxwss获得移动平均线?
我收到此错误['error', 11010, 'ratelimit: error']
我试过浏览文档,但找不到任何相关内容。
import requests
import pandas as pd
import time as t
import numpy as np
time =np.round(t.time()*1000)
day_20_BTC = pd.DataFrame()
while time > 1513400784000:
url = 'https://api.bitfinex.com/v2/trades/tBTCUSD/hist?end='+str(time)+'&limit=1000&sort=-1'
r = requests.get(url)
data = r.json()
data = pd.DataFrame(data,columns=["ID","Timestamp","Amount","Price"])
time = data.Timestamp.iloc[-1]
day_20_BTC = pd.concat([day_20_BTC,data],axis=0)
t.sleep(30)