需要一点帮助,我不想在每根蜡烛下都贴上标签

发布于 2025-01-13 14:04:26 字数 1255 浏览 0 评论 0原文

输入图片这里的描述需要一点帮助,下面的代码工作正常,但看起来很脏,因为它将标签放在每个蜡烛下面,有没有办法防止这种情况。

//@version=5
indicator(title='4EMA', shorttitle='4EMA', overlay=true)
show = input.bool(true, title="Cash Control Strateji", group='Stratejiler')
Length1 = input.int(8, minval=1)
Length2 = input.int(13, minval=1)
Length3 = input.int(21, minval=1)
Length4 = input.int(55, minval=1)

xPrice = close

xEMA1 = ta.ema(xPrice, Length1)
xEMA2 = ta.ema(xPrice, Length2)
xEMA3 = ta.ema(xPrice, Length3)
xEMA4 = ta.ema(xPrice, Length4)

plot(xEMA1, color=color.new(color.blue, 0), title='4EMA 8')
plot(xEMA2, color=color.new(color.green, 0), title='4EMA 13')
plot(xEMA3, color=color.new(color.orange, 0), title='4EMA 21')
plot(xEMA4, color=color.new(color.red, 0), title='4EMA 55')

a = ta.ema(close, Length1)
b = ta.ema(close, Length2)
c = ta.ema(close, Length3)
d = ta.ema(close, Length4)

condition = (a>b) and (b>c) and (c>d)

plotshape(show ? condition : na,title='Heikinashi Strateji', text='Ha.Al.', location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0))

enter image description hereneed a little help, the code below works fine but it looks so dirty because it puts labels under each candle, is there a way to prevent this.

//@version=5
indicator(title='4EMA', shorttitle='4EMA', overlay=true)
show = input.bool(true, title="Cash Control Strateji", group='Stratejiler')
Length1 = input.int(8, minval=1)
Length2 = input.int(13, minval=1)
Length3 = input.int(21, minval=1)
Length4 = input.int(55, minval=1)

xPrice = close

xEMA1 = ta.ema(xPrice, Length1)
xEMA2 = ta.ema(xPrice, Length2)
xEMA3 = ta.ema(xPrice, Length3)
xEMA4 = ta.ema(xPrice, Length4)

plot(xEMA1, color=color.new(color.blue, 0), title='4EMA 8')
plot(xEMA2, color=color.new(color.green, 0), title='4EMA 13')
plot(xEMA3, color=color.new(color.orange, 0), title='4EMA 21')
plot(xEMA4, color=color.new(color.red, 0), title='4EMA 55')

a = ta.ema(close, Length1)
b = ta.ema(close, Length2)
c = ta.ema(close, Length3)
d = ta.ema(close, Length4)

condition = (a>b) and (b>c) and (c>d)

plotshape(show ? condition : na,title='Heikinashi Strateji', text='Ha.Al.', location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉睡月亮 2025-01-20 14:04:26

如果您只想在第一次出现时获得它们,您可以这样做:

plotshape(show ? condition and not condition[1] : na,title='Heikinashi Strateji', text='Ha.Al.', location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0))

干杯,祝您好运

if you want them just on the first occurrence you can do this:

plotshape(show ? condition and not condition[1] : na,title='Heikinashi Strateji', text='Ha.Al.', location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0))

Cheers and best of luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文