仅更改第七栏的颜色 - (特定的蜡烛颜色交易图)

发布于 2025-01-21 20:57:19 字数 321 浏览 3 评论 0原文

我想改变一支蜡烛的颜色。例如,仅第七。

我尝试了barcolor和偏移量,但它也指出了以前的所有7个,您能帮我一个黄色的第7个吧吗?

 //@version=5
indicator('Previous Candle High and Low', shorttitle='Prev. H/L', overlay=true)
dt = time - time[1]
patternLabelPosHigh = close[7]


barcolor(color=bar_index ? color.yellow : na, offset=-6)

谢谢 !

I would like to change the color of a single candle. For example only the 7th.

I tried with barcolor and offset but it also points out all the previous ones of 7, Can you help me to get only the 7th bar in yellow ?

 //@version=5
indicator('Previous Candle High and Low', shorttitle='Prev. H/L', overlay=true)
dt = time - time[1]
patternLabelPosHigh = close[7]


barcolor(color=bar_index ? color.yellow : na, offset=-6)

Thank you !

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

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

发布评论

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

评论(1

铃予 2025-01-28 20:57:19

如果您想追溯仅绘制左侧的第七栏并重新绘制结果,则必须检查当前条的状态。

下面的结构看起来多余,但是就我测试而言,它涵盖了所有可能的市场状态,下面的脚本将不断向左画7个bar,并在每个新栏上重新绘制:

//@version=5
indicator("Past barcolor()")
pastBar = input.int(7, title = "Past Bar", minval = 1)     
barcolor((barstate.islast or barstate.isrealtime) and (not barstate.isconfirmed or barstate.islastconfirmedhistory) ? color.new(color.blue, 0) : na, offset = - pastBar)

If you would like to retroactively paint only the 7th bar to the left and redraw the results, you have to check the current bar's state.

The construction below looks redundant, however it covers all possible states of the market as far as I tested, the script below will constantly paint 7th bar to the left and redraw on every new bar:

//@version=5
indicator("Past barcolor()")
pastBar = input.int(7, title = "Past Bar", minval = 1)     
barcolor((barstate.islast or barstate.isrealtime) and (not barstate.isconfirmed or barstate.islastconfirmedhistory) ? color.new(color.blue, 0) : na, offset = - pastBar)

enter image description here

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