派恩止损?
我想在每个条目上设置停止损失。如果价格与入口价格下降2%,
//@version=5
strategy(title="Test ", calc_on_every_tick=false)
haHandle=ticker.heikinashi(syminfo.tickerid)
haOpen=request.security(haHandle,timeframe.period,open)
haClose=request.security(haHandle,timeframe.period,close)
haDeltaAbs=haClose-haClose[1]
haDeltaRel=haDeltaAbs/haClose[1]*100
haEntryCondition = haDeltaRel > 0 and haDeltaRel[1] < 0
strategy.entry("trade", strategy.long, when = haEntryCondition, stop = ????)
strategy.close("trade", when = ta.falling(haClose, 1))
plot(na, "Zero line", color.gray)
但在Pine文档中没有关于如何使用此“停止”参数的迹象,这至少是设置停止损失的正确论点吗?
此致
I would like to set a stop loss on each of my entries. The stop loss would triger if the price goes down by 2% from the entry price
//@version=5
strategy(title="Test ", calc_on_every_tick=false)
haHandle=ticker.heikinashi(syminfo.tickerid)
haOpen=request.security(haHandle,timeframe.period,open)
haClose=request.security(haHandle,timeframe.period,close)
haDeltaAbs=haClose-haClose[1]
haDeltaRel=haDeltaAbs/haClose[1]*100
haEntryCondition = haDeltaRel > 0 and haDeltaRel[1] < 0
strategy.entry("trade", strategy.long, when = haEntryCondition, stop = ????)
strategy.close("trade", when = ta.falling(haClose, 1))
plot(na, "Zero line", color.gray)
But there is no indications in Pine documentation on how to use this "stop" argument, is it at least the right argument for setting a stop-loss ?
Best regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该为此使用
straging.exit()
。You should use
strategy.exit()
for that.