stra_exit_long平仓错误 #127
Guan2019310358
started this conversation in
General
Replies: 1 comment
-
用context.stra_set_position(code, 0)吧,不用考虑持仓方向问题。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
curPos = context.stra_get_position(code,True)
context.stra_exit_long(code, curPos, 'exitlong')
以上代码平掉所有仓位,无法实现T+1式平仓。
context.stra_exit_long(code, 300, 'exitlong')
该方法的平仓数量有时候会出现错误。
Beta Was this translation helpful? Give feedback.
All reactions