源码: function main(){ Log(“当前持仓”,exchange.GetPosition());
}
回测时结果:
调试debug时结果:
小草 回测是模拟的,和你交易所账户没关系,没开仓当然是空的
jasperrr 平多单设置 exchange.SetDirection("closebuy"); 报错Futures_OP 0: MarginLevel can only be set in the direction for buy/sell , current settings: closebuy
jasperrr 回测时调用exchange.GetPosition()[0].Amount,报错:main:2:38 - TypeError: Cannot read property 'Amount' of undefined
小草 回测的永续合约吗,https://www.fmz.com/bbs-topic/4158#%E6%9C%9F%E8%B4%A7%E5%BC%80%E4%BB%93%E5%B9%B3%E4%BB%93
小草 没持仓是空数组,无法用exchange.GetPosition()[0]