avatar of niuyuhubotvs niuyuhubotvs
关注 私信
0
关注
0
关注者

exchange.SetContractType设置this_week和next_week,获取GetPosition无效

创建于: 2018-05-07 00:08:35, 更新于:
comments   3
hits   1753

代码如下: for (i = 0; i < 2; i++) { exchange.SetContractType(ContractTypes[i]); var positions = exchange.GetPosition(); Log(‘148: ‘, positions); }

代码日志如下,也就是两次获取position都是this_week的,而期望获取this_week和next_week的持仓信息: 2018-05-06 09:22:00 信息 148: [{“Price”:23.15,“Amount”:3,“FrozenAmount”:0,“Profit”:0.11199735,“Margin”:0.12958962,“MarginLevel”:10,“Type”:0,“ContractType”:“this_week”}] 2018-05-06 09:22:00 信息 148: [{“Price”:23.15,“Amount”:3,“FrozenAmount”:0,“Profit”:0.11199735,“Margin”:0.12958962,“MarginLevel”:10,“Type”:0,“ContractType”:“this_week”}]

哪位大神可以帮忙解答以上问题,多谢多谢!!!

相关推荐
全部留言
avatar of 发明者量化-小小梦
发明者量化-小小梦
代码执行的那一刻, 确定 有 next_week 持仓么 ?如果 都有 持仓, 那么 切换合约后应该是 可以获取到的。
2018-05-07 08:53:27
avatar of niuyuhubotvs
niuyuhubotvs
结果显示两次都是this_week
2018-05-07 23:43:38
avatar of niuyuhubotvs
niuyuhubotvs
若没有持仓,不应该返回[]吗,而现在是返回数据一样。谢谢
2018-05-07 23:42:57