-
wtpy版本: 0.9.10python版本: 3.10.2操作系统: windows 11 x64问题描述期货回测中,空开后,在on_calculate中调用context.stra_get_position中获取的仓位为正数,按文档中所说,持有空仓获取的值应为负数,可是为何持有空仓返回正数,求助! 文档相关内容https://wtdocs.readthedocs.io/zh/latest/docs/apis/interfaces.html#id3 代码on_calculate下单多下单空运行策略日志 |
Beta Was this translation helpful? Give feedback.
Answered by
zjokerxxx
Sep 29, 2024
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
测试当使用stra_get_position传入usertag参数时,空仓获取的仓位为正数,当不传入usertag参数时,空仓获取的仓位为负数。 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zjokerxxx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
测试当使用stra_get_position传入usertag参数时,空仓获取的仓位为正数,当不传入usertag参数时,空仓获取的仓位为负数。
是否可以理解为,当传入usertag时,策略中可以根据usertag来判断仓位的多空?