Hi,
I would like to match the changes in background color from study pane in the price study. Say MACD above MACDSig = green background & below = red.
I have the following in the study pane efs:
and the price pane efs that gets the global variable is:
But the color in the price pane stays green and never changes to red to match background colors in the study pane.
Seems that the global variable doesn't update after the first value is passed. I've tried using the removeGlobalValue() in several places without success.
Thanks
wayne
I would like to match the changes in background color from study pane in the price study. Say MACD above MACDSig = green background & below = red.
I have the following in the study pane efs:
PHP Code:
if(vMACD > vMACDSig){
vBgColor = Color.RGB(202,241,188);
setGlobalValue("gBgColor",Color.RGB(202,241,188));
}else if(vMACD < vMACDSig){
vBgColor = Color.RGB(218,212,254);
setGlobalValue("gBgColor",Color.RGB(218,212,254));
}else {
vBgColor = Color.white;
setGlobalValue("gBgColor",Color.white);
}
PHP Code:
debugClear();
function preMain(){
setPriceStudy(true);
setStudyTitle("BgColor2");
}
function main(){
var vBgColor,vBgCol0,vHighest;
vBgColor = getGlobalValue("gBgColor");
vHighest = hhv(50,high());
setBarBgColor(vBgColor, 0, null, vHighest);
}
Seems that the global variable doesn't update after the first value is passed. I've tried using the removeGlobalValue() in several places without success.
Thanks
wayne
Comment