0
Follow
0
Followers
Как это было получено и спроектировано?
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 (7)
function main() {
// https://fx-api.gateio.ws/api/v4/futures/funding_rate?contract=BTC_USD
// /api/swap/v3/instruments/BTC-USD-SWAP/historical_funding_rate?from=1&limit=2
var gate_io_rateUrl = "https://fx-api.gateio.ws/api/v4/futures/funding_rate?contract=" + _GateIO_CurrencyPair // BTC_USD
var okex_rateUrl = "https://www.okex.me/api/swap/v3/instruments/" + _OKEX_CurrencyPair + "/historical_funding_rate"
while(1) {
var strGate_io_rate = HttpQuery(gate_io_rateUrl, null, null, "Accept: application/json")
var strOKEX_rate = HttpQuery(okex_rateUrl)
// Log("strGate_io_rate:", strGate_io_rate)
// Log("strOKEX_rate:", strOKEX_rate)
var jsonGate_rate
var jsonOKEX_rate
try {
jsonGate_rate = JSON.parse(strGate_io_rate)
jsonOKEX_rate = JSON.parse(strOKEX_rate)
} catch(e) {
Log(e)
}
Log("GATE.IO", jsonGate_rate[0])
Log("OKEX", jsonOKEX_rate[0])
Sleep(500)
}
}
可以参考这个代码,目前OKX的V3接口停用了,要把请求地址https://www.okex.me/api/swap/v3/instruments换成目前交易所V5接口,可以在OKX的API文档上查询具体的资金费率接口。
4 years ago
- 1
