[英]pine script : color the current candle different color
我想給所有蠟燭上色,所有向下的蠟燭都是紅色的,所有向上的蠟燭都是綠色的,當前的蠟燭是黑色的(如果還沒有關閉)
這是例如
//@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)
你使用barstate.isconfirmed
函數
//@version=5
indicator("barcolor example", overlay=true)
barcolor(barstate.isconfirmed ? na : color.black)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.