【问题标题】:pine script : color the current candle different color松脚本:为当前蜡烛着色不同的颜色
【发布时间】:2022-10-25 10:07:03
【问题描述】:

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

这是例如

//@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)

【问题讨论】:

    标签: pine-script cryptocurrency pine-script-v4 forex


    【解决方案1】:

    你使用barstate.isconfirmedfunction

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

    【讨论】:

      猜你喜欢
      • 2023-01-27
      • 1970-01-01
      • 2018-10-12
      • 1970-01-01
      • 2022-11-17
      • 1970-01-01
      • 1970-01-01
      • 2011-05-24
      • 2021-01-02
      相关资源
      最近更新 更多