Hi all,
In Trading View, I had coloured my bars depending on the close of the bar. In Pinescipt V5, the code looked like this:
indicator(“Bar Color”, overlay=true)
//Bull bar 1/4
data1 = close > ((high – low) * 0.75) + low
barcolor(close > ((high – low) * 0.75) + low ? #27af40 : na)
//Bull bar 1/3
data2 = close > ((high – low) * 0.666) + low and close < ((high – low) * 0.75) + low
barcolor(close > ((high – low) * 0.666) + low and close < ((high – low) * 0.75) + low? #24532d : na)
//Neutral Bull bar
data3 = close < (((high – low) * 0.666) + low) and close > (high – ((high – low) * 0.666)) and close > open
barcolor(close < (((high – low) * 0.666) + low) and close > (high – ((high – low) * 0.666)) and close > open? #a5dfb2 : na)
If anyone here can help me convert this code to ProBuilder I would be very grateful.
Philip