3
Follow
1505
Followers
策略原理:https://www.fmz.com/digest-topic/10457
源码解释:https://www.fmz.com/digest-topic/10461
需要OKX期货账户,单向持仓模式
Source
JavaScript
function GetPosition(pair){
let pos = _C(exchange.GetPosition, pair)
if(pos.length == 0){
return {amount:0, price:0, profit:0}
}else if(pos.length > 1){
throw '不支持双向持仓'
}else{
return {amount:pos[0].Type == 0 ? pos[0].Amount : -pos[0].Amount, price:pos[0].Price, profit:pos[0].Profit}
}
}
function GetRatio(){Strategy parameters
Related strategies
Comment
All comments (0)
No data
- 1
