枢轴点添加退出策略
我在 Tradingview 上发现了这个基于枢轴点的策略。我尝试在 R3 / S3 上添加退出策略,但它不起作用。有人可以帮助我吗?
strategy.risk.allow_entry_in(tradeDirection)
longCondition = crossover(Source, R1) and inDateRange
shortCondition = crossunder(Source, S1) and inDateRange
strategy.entry("Buy", strategy.long, when=longCondition, oca_name="oca",
oca_type=strategy.oca.cancel)
strategy.exit("Exit Long", stop=R3)
strategy.entry("Sell", strategy.short, when=shortCondition, oca_name="oca",
oca_type=strategy.oca.cancel)
strategy.exit("Exit Short", stop=S3)
I found this strategy on Tradingview based on pivot points. I tried to add an exit strategy on R3 / S3 but it doesn't work. Can someone help me?
strategy.risk.allow_entry_in(tradeDirection)
longCondition = crossover(Source, R1) and inDateRange
shortCondition = crossunder(Source, S1) and inDateRange
strategy.entry("Buy", strategy.long, when=longCondition, oca_name="oca",
oca_type=strategy.oca.cancel)
strategy.exit("Exit Long", stop=R3)
strategy.entry("Sell", strategy.short, when=shortCondition, oca_name="oca",
oca_type=strategy.oca.cancel)
strategy.exit("Exit Short", stop=S3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用限制停止
use limit for stop