簡體   English   中英

松腳本:為當前蠟燭着色不同的顏色

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM