在strategy.exit()上执行一些操作
我想更改几个变量,或者可能在 Strategy.exit() 上调用一个函数,以防止在同一柱上打开新交易(我已将“计算每个价格变动”设置为 true),但不能找到办法。有什么语法可以做到吗? 这实际上很奇怪,因为当我有 ta.cross() 时,我会触发strategy.entry(),但是一旦交易结束,如果在同一个柱中发生了 ta.cross(),策略将再次进入,并且当然不是ta.cross的价格。 :(((
我很想在strategy.exit()上更新一个标志。
I'd like to change a couple of variables or maybe call a function upon strategy.exit(), preventing a new trade to open on the same bar (I have "calculate on every tick" set to true), but can't find a way. Is there any syntax to do it?
It's actually odd, because I trigger strategy.entry() when I have a ta.cross(), but once the trade closes, if in that same bar a ta.cross() has occurred, the strategy will entry again, and of course not at the ta.cross price. :(((
I would love to update a flag upon strategy.exit().
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其添加到您的进入条件怎么样?
除最新关闭交易已退出的柱外,所有柱均如此。因此,您可以说这样的话将其添加到您的入场条件中:
干杯,祝您交易和编码好运
How about adding this to your entry condition?
This would be true on all bars except on the bar the latest closed trade has exited. So you could say something like this to add it to your entry condition:
Cheers and best of luck with your trading and coding