Hello,
I have the following code. It gives me a invalid array. What am I doing wrong? When i do Array(1), it works well but I don't give any values.
-Mike
function main() {
var nNumberBars;
var nIndex = getCurrentBarIndex();
nNumberBars = getNumBars();
// if (bInit == false) {
KS = middleDonchian(27);
buffer = atr(5);
//drawShapeRelative(0,high(0)+buffer, Shape.SQUARE,null,Color.blue,Shape.TOP);
if (close(0) > KS.getValue(0) )
{
dotvalue = KS - buffer;
drawShapeRelative(0,dotvalue, Shape.CIRCLE,null,Color.green,Shape.TOP)
} else {
dotvalue = KS + buffer;
drawShapeRelative(0,dotvalue, Shape.CIRCLE,null,Color.green,Shape.TOP)
}
return new Array(dotvalue);
}
I have the following code. It gives me a invalid array. What am I doing wrong? When i do Array(1), it works well but I don't give any values.
-Mike
function main() {
var nNumberBars;
var nIndex = getCurrentBarIndex();
nNumberBars = getNumBars();
// if (bInit == false) {
KS = middleDonchian(27);
buffer = atr(5);
//drawShapeRelative(0,high(0)+buffer, Shape.SQUARE,null,Color.blue,Shape.TOP);
if (close(0) > KS.getValue(0) )
{
dotvalue = KS - buffer;
drawShapeRelative(0,dotvalue, Shape.CIRCLE,null,Color.green,Shape.TOP)
} else {
dotvalue = KS + buffer;
drawShapeRelative(0,dotvalue, Shape.CIRCLE,null,Color.green,Shape.TOP)
}
return new Array(dotvalue);
}
Comment