Hello,
I have created a basic watch list EFS based on the Kraut_ColoredBarsIndWL.efs obtained from this thread.
I can't work out why the two columns my script adds to the WL only show predominantly red dots.
I would appreciate any guidance in correcting any errors.
Thank you
Mark
I have created a basic watch list EFS based on the Kraut_ColoredBarsIndWL.efs obtained from this thread.
I can't work out why the two columns my script adds to the WL only show predominantly red dots.
I would appreciate any guidance in correcting any errors.
PHP Code:
var bInit = false;
var vMA_Fast = null;
var vMA_Slow = null;
//********************************************************************************************
function preMain() {
//********************************************************************************************
setCursorLabelName("Range", 0);
setCursorLabelName("Active", 1);
}
//********************************************************************************************
function main() {
//********************************************************************************************
var range = high(0) - low(0);
var range_1 = high(-1) - low(-1);
var range_2 = high(-2) - low(-2);
var vColor = "";
var vMA_Slow
var vMA_Fast
if (!bInit)
{
vMA_Slow = ema(34,close());
vMA_Fast = ema(15,close());
bInit = true;
}
var nMA_Fast = vMA_Fast.getValue(0);
var nMA_Slow = vMA_Slow.getValue(0);
var nMA_Fast_1 = vMA_Fast.getValue(-1);
var nMA_Fast_2 = vMA_Fast.getValue(-2);
var nMA_Fast_3 = vMA_Fast.getValue(-3);
var nMA_Slow_1 = vMA_Slow.getValue(-1);
var nMA_Slow_2 = vMA_Slow.getValue(-2);
var nMA_Slow_3 = vMA_Slow.getValue(-3);
// if (nBarState == BARSTATE_CURRENTBAR)
// {
if (range > range_1 * 3 && range_1 > range_2)
{
setBarBgColor(Color.green,0);
vColor = "GREEN"
}
else
{
setBarBgColor(Color.blue,0);
vColor = "BLUE"
}
// }
if (nMA_Fast > nMA_Fast_1 && nMA_Fast_1 > nMA_Fast_2 && nMA_Fast_2 > nMA_Fast_3)
{
setBarBgColor(Color.green,1);
vColor = "GREEN"
}
else
{
setBarBgColor(Color.red,1);
vColor = "RED"
}
return Array(nMA_Fast, vColour);
}
Thank you
Mark
Comment