We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug
回测的时候,在用limit_order 开单成功后,在 on_trade() 里面新下一个止损的停止单。 这个停止单会被当前bar 触发成交,这是不合理的
backtesting 的执行逻辑如下,cross_limit_order() 里面触发 on_trade(), 然后新发出一个止损的stop_order。 这个stop_order 会被下面的 cross_stop_order() 触发成交,当前bar 已经走完,这里触发成交是不合理的。
` def new_bar(self, bar: BarData) -> None: """""" self.bar = bar self.datetime = bar.datetime
self.cross_limit_order() self.cross_stop_order() self.strategy.on_bar(bar)
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
环境
Issue类型
Bug
重现步骤
回测的时候,在用limit_order 开单成功后,在 on_trade() 里面新下一个止损的停止单。
这个停止单会被当前bar 触发成交,这是不合理的
问题分析
backtesting 的执行逻辑如下,cross_limit_order() 里面触发 on_trade(), 然后新发出一个止损的stop_order。
这个stop_order 会被下面的 cross_stop_order() 触发成交,当前bar 已经走完,这里触发成交是不合理的。
` def new_bar(self, bar: BarData) -> None:
""""""
self.bar = bar
self.datetime = bar.datetime
`
The text was updated successfully, but these errors were encountered: