Hi,
Multiple "setBarBgColor" on the same bar index but at different y coordinates do not plot when coded within the same efs study.
Say, setBarBgColor that colors bkgd green 1 point above the high and 1 point below the low. Then a second setBarBgColor that plots above the high plus 1 point that colors bkgd yellow above the green bkgrd colored first so both show, the green below the yellow bkgd.
The problem is that only one plots as shown in the attached image.
This is the code I've tried (I've also changed the order of setBarBgColor() but the results don't change):
Is there a way to have different background colors on the same bar index where on plots above or below the other?
I can do this with different efs studies on the same chart but can it be done with code within only one efs study?
Thanks in advance.
wayne
Multiple "setBarBgColor" on the same bar index but at different y coordinates do not plot when coded within the same efs study.
Say, setBarBgColor that colors bkgd green 1 point above the high and 1 point below the low. Then a second setBarBgColor that plots above the high plus 1 point that colors bkgd yellow above the green bkgrd colored first so both show, the green below the yellow bkgd.
The problem is that only one plots as shown in the attached image.
This is the code I've tried (I've also changed the order of setBarBgColor() but the results don't change):
PHP Code:
//Should color bkgd from 1 point below low to 1 point above high.
if (nRes == 1)
setBarBgColor(Color.RGB(160, 255, 160),0,low(0)-BgOffset,high(0)+BgOffset);
else
if (nRes == 0)
setBarBgColor(Color.RGB(255,160,160),0,low(0)-BgOffset,high(0)+BgOffset);
//Below should color starting at the high plus 1 point (so starts above the above codes bkgd color)
if(vMA_Avg1Diff > 0 && vStrengthPlot0 > vMA_Avg0){
// setBarBgColor(RGB(219,253,193),0,low(0)-(ColorOffset*1),high(0)+(ColorOffset*1));
setBarBgColor(RGB(219,253,193),0,high(0)+BgOffset,high(0)+BgOffset+5);
}else if(vMA_Avg1Diff < 0 && vStrengthPlot0 < vMA_Avg0){
// setBarBgColor(Color.RGB(255,230,195),0,low(0)-(ColorOffset*1),high(0)+(ColorOffset*1));
setBarBgColor(Color.RGB(255,230,195),0,high(0)+BgOffset,high(0)+BgOffset+5);
}
I can do this with different efs studies on the same chart but can it be done with code within only one efs study?
Thanks in advance.
wayne
Comment