Can I change the entire background color on an indicator trigger? Like 0=red, 1=green?
This a custom version of RSI:
MyRSI = Rsi[14](close)
if MyRSI >= 50 THEN
backgroundcolor(0,255,0,20)
ELSE
backgroundcolor(255,0,0,30)
ENDIF
RETURN MyRSI AS "Rsi"
Hi Roberto,
Is there a way to change colour on chart based on price rather than an indicator?
Thanks in advance
W 🙂
Yes:
If close > X then
//set a background colour
Else
//set a different background colour
Endif
Hi Roberto,
I am really bad with coding, I wonder if you can help me.
While trading on a 5 min chart using Heikin Ashi candlesticks, I would like to plot on chart a background color that matches the color of the price candle sticks as they form.. is there a way to achieve this or at least plot the background matching the colour of previous candle color closure?
Thanks a lot
W 🙂
JSParticipant
Senior
//Heikin Ashi
If BarIndex = 0 then
HAClose = TotalPrice
HAOpen = (Open + Close)/2
Else
HAClose = TotalPrice
HAOpen = (HAOpen[1] + HAClose[1])/2
EndIf
If HAClose >= HAOpen then
BackGroundColor(0,255,0,50)
Else
BackGroundColor(255,0,0,50)
EndIf
Return
JSParticipant
Senior
Hi @Wolf,
The above is only for Heikin Ashi because, as you probably know, the calculations for HA are different than for the “normal” candles.
@JS Sure, thanks a million and have a great weekend! 🙂