松文脚本:当前蜡烛的颜色不同的颜色

发布于 2025-01-27 14:17:31 字数 432 浏览 3 评论 0原文

我想为所有蜡烛上色,所有的蜡烛都会是红色的,所有蜡烛都将是绿色的,当前的蜡烛将是黑色的(如果还没有关闭),

例如

//@version=4
study("color all except current candle", overlay=true)

this_is_current_candle_function = ?????????????

redbar = close < open
greenbar = close > open

barcolor(not this_is_current_candle_function and redbar ? color.red:color.black)
barcolor(not this_is_current_candle_function and greenbar ? color.green:color.black)

i wanna to color all candles , all down candles will be red ,, all up candle will be green and the current candle will be black (if not closed yet)

this is for example

//@version=4
study("color all except current candle", overlay=true)

this_is_current_candle_function = ?????????????

redbar = close < open
greenbar = close > open

barcolor(not this_is_current_candle_function and redbar ? color.red:color.black)
barcolor(not this_is_current_candle_function and greenbar ? color.green:color.black)

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

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

发布评论

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

评论(1

格子衫的從容 2025-02-03 14:17:31

您使用barstate.isconfirded函数

    //@version=5
    indicator("barcolor example", overlay=true)
    barcolor(barstate.isconfirmed ? na : color.black)

you use barstate.isconfirmedfunction

    //@version=5
    indicator("barcolor example", overlay=true)
    barcolor(barstate.isconfirmed ? na : color.black)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文