Type/to search
4
Follow
26
Followers
Môi trường nghiên cứu, python, lấy dữ liệu bitmex xbtusd lỗi: EOFError
Help
Created 2019-10-12 11:58:16  
 1
 2109

Trong môi trường nghiên cứu, chỉ dẫn cho người mới bắt đầu - BTC_USDT của sàn giao dịch OKEX trong Python, chuyển đổi thành XBTUSD của bitmex, thực hiện exchange.GetTicker () báo cáo EOFError

Mã đầy đủ là:

'''backtest
start: 2019-09-12 00:00:00
end: 2019-10-11 00:00:00
period: 1h
exchanges: [{"eid":"Futures_BitMEX","currency":"XBT_USD"}]
'''

Nhận xét trên là thiết lập phản hồi

from fmz import * # nhập tất cả các hàm FMZ
task = VCtx(doc) # Initialization

ticker = exchange.GetTicker()
print(ticker)
print ((' giá giao dịch mới nhất:', ticker['Last'])

Cảm ơn bạn!

Related Recommendations
Comment
All comments (1)

    回测完成的时候是会抛出一个EOF异常作为回测结束。
    这个是正常的。
    但是您这个报错是因为,没有设置合约,需要在调用exchange.GetTicker()之前使用exchange.SetContractType("XBTUSD")设置一下合约,否则获取不到行情,回测就直接结束了,就抛出EOF异常了。

    7 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)