I'd like to set the chart background color different for different price ranges. For example, I'd like 1290-1295 to be blue, 1296-1300 to be yellow, ... I'm using setDefaultBarBgColor with its yMin and yMax parameters, one for each price range. However, it seems that only the last setDefaultBarBgColor sticks. What am I doing wrong?
Announcement
Collapse
No announcement yet.
How to set multiple chart background colors?
Collapse
X
-
almerger
In order to use multiple background colors on the same bar you need to have more than one item in the return statement so as to assign each background color to a different seriesIndex. The elements of the return array can also be strings (which will not plot on the chart)
Alex
-
I'm trying this in main():
var mkt = close(0);
setDefaultBarBgColor(Color.blue,0,mkt+5,mkt+10);
setDefaultBarBgColor(Color.red,1,mkt-10,mkt-4);
setDefaultBarBgColor(Color.yellow,2,mkt-4,mkt+4);
return ("A","B","C");
but only the blue portion is painting. Do you know why? Thanks.
Comment
Comment