取首签松脚本
我一直在尝试在版本 2 中进行构建登录。但是,这在版本 4 中执行。 有人可以在版本 2 中帮我解决这个问题吗?非常感谢
// Determine currently LONG or SHORT
isLong = nz(isLong[1], false)
isShort = nz(isShort[1], false)
// Buy or Sell only if the buy signal is triggered and not already long or short
buySignal = not isLong and buy
sellSignal = not isShort and sell
if (buySignal)
isLong := true
isShort := false
if (sellSignal)
isLong := false
isShort := true
plotshape(series=buySignal, text='Buy', style=shape.labelup, location=location.belowbar, offset=0, color=#009688, textcolor=#ffffff, size=size.small)
plotshape(series=sellSignal, text='Sell', style=shape.labeldown, location=location.abovebar, offset=0, color=#F44336, textcolor=#ffffff, size=size.small)
I've been trying for the build sign in version 2. However this is getting executed in version 4.
Can someone help me with this in version 2? Thank you so much
// Determine currently LONG or SHORT
isLong = nz(isLong[1], false)
isShort = nz(isShort[1], false)
// Buy or Sell only if the buy signal is triggered and not already long or short
buySignal = not isLong and buy
sellSignal = not isShort and sell
if (buySignal)
isLong := true
isShort := false
if (sellSignal)
isLong := false
isShort := true
plotshape(series=buySignal, text='Buy', style=shape.labelup, location=location.belowbar, offset=0, color=#009688, textcolor=#ffffff, size=size.small)
plotshape(series=sellSignal, text='Sell', style=shape.labeldown, location=location.abovebar, offset=0, color=#F44336, textcolor=#ffffff, size=size.small)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的脚本升级到
v5
并删除isShort
,您不需要它。Upgrade your script to
v5
and get rid ofisShort
, you don't need it.