0
Follow
1
Followers
#url = "https://fapi.binance.com/fapi/v1/klines"
#get获得k线合约数据
url = "https://fapi.binance.com/fapi/v3/klines"
#get获得k线现货数据
params = {
"symbol": Symbol,
"interval": str(timeperiod) + "m",
"limit": 1000
} #ema_timeperiod_2 * 2
response = requests.get(url, params=params)
data = response.json()
执行V1获取合约数据没问题,执行V3获取现货数据就出错了,同样的代码,在vscode里执行就没问题,可以获得V3数据。
错误信息Traceback (most recent call last): File "<string>", line 1249, in init_ctx File "<string>", line 367, in <module> File "<string>", line 345, in listen_agg_trade requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
求教,搞不定了谢谢
Related Recommendations
Inventor Quant Workflow FAQ (Continuously Updated)Financial Magic Zone Global KOL RecruitmentFAQ Summary (Updating...)PINE Language Introductory Tutorial of FMZ QuantPrimary Tutorial of Strategy Writing with FMZ Quant Trading Platform (Must Read)Getting Started with FMZ Quant Trading Platform (Must Read)MyLanguage DocFMZ PINE Script DocNotes & Explanation of Futures Reverse Doubling Algorithm StrategySolutions to Obtaining Docker Http Request Message
Comment
All comments (3)
是的梦总,我的意思是 用/api/v3/klines 就是url = "https://fapi.binance.com/fapi/v3/klines" 这个url 取现货数据的时候出错。我是两个get 一个取现货一个取期货
3 years ago
- 1
