Type/to search
0
Follow
0
Followers
Problemas de posición en los contratos perpetuos
Help
Created 2022-10-01 17:01:21  
 7
 1400

¿Cómo se obtiene y diseña esto?

Related Recommendations
Comment
All comments (7)

    您好,是要获取资金费率,产生的资费?

    4 years ago

    是这样一个场景,比如四个币种,开仓后要达到某一盈利或者止损点平仓,永续长持几天后,这个资金费如果不算出来,盈利或止损的点 就会不对

    4 years ago

    可以使用交易所资金费率接口计算资金费。一般交易所都有这样的接口。

    4 years ago

    能给个fmz OK的例子的吗,不会用交易所原始的API。

    4 years ago
    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

    不客气,感谢支持FMZ量化。

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