无法在绘图变量分组后查看级别



我在这样的指示器中对图进行了分组。它发挥了作用,并根据我的意愿对我的情节进行了分组。但在那之后,线条就变得看不见了。请帮我解决这个问题。

这是原始剧本。

ADR1_high = plot(_adr1_high, title=text_ADR1_high, color=ta.change(_adr1_high) ? na : color_ADR1_high, style=plot.style_circles, linewidth=1)
ADR2_high = plot(_adr2_high, title=text_ADR2_high, color=ta.change(_adr2_high) ? na : color_ADR2_high, style=plot.style_circles, linewidth=1)
ADR1_low = plot(_adr1_low, title=text_ADR1_low, color=ta.change(_adr1_low) ? na : color_ADR1_low, style=plot.style_circles, linewidth=1)
ADR2_low = plot(_adr2_low, title=text_ADR2_low, color=ta.change(_adr2_low) ? na : color_ADR2_low, style=plot.style_circles, linewidth=1)
fill(ADR1_high, ADR2_high, title=text_upper_fill, color = ta.change(_adr1_high) ? na : color.new(adrUppercolorfill, 80))
fill(ADR1_low, ADR2_low, title=text_lower_fill, color = ta.change(_adr1_low) ? na : color.new(adrlowercolorfill, 80))

这是我添加并更改的代码。

ADR = 1
showADRInput = input(true, "Show ADR", group='ADR')
ADR1_high = plot(_adr1_high ? ADR : na, title=text_ADR1_high, color=ta.change(_adr1_high) ? na : color_ADR1_high, style=plot.style_circles, linewidth=1)
ADR2_high = plot(_adr2_high ? ADR : na, title=text_ADR2_high, color=ta.change(_adr2_high) ? na : color_ADR2_high, style=plot.style_circles, linewidth=1)
ADR1_low = plot(_adr1_low ? ADR : na, title=text_ADR1_low, color=ta.change(_adr1_low) ? na : color_ADR1_low, style=plot.style_circles, linewidth=1)
ADR2_low = plot(_adr2_low ? ADR : na, title=text_ADR2_low, color=ta.change(_adr2_low) ? na : color_ADR2_low, style=plot.style_circles, linewidth=1)
fill(ADR1_high, ADR2_high, title=text_upper_fill, color = ta.change(_adr1_high) ? na : color.new(adrUppercolorfill, 80))
fill(ADR1_low, ADR2_low, title=text_lower_fill, color = ta.change(_adr1_low) ? na : color.new(adrlowercolorfill, 80))

您的绘图函数中的这一部分:_adr1_high ? ADR : na,它只会绘制1,而不是您定义的ADR = 1中的_adr1_high,所以从技术上讲,这些线不是不可见的,只是值太小,您可以调整价格比例来查看它们。这与分组无关。

你可能想要这样的东西:

ADR1_high = plot(showADRInput ? _adr1_high : na, title=text_ADR1_high, color=ta.change(_adr1_high) ? na : color_ADR1_high, style=plot.style_circles)

最新更新