just testing hhv but not getting expected results, can anyone advise?

function main(){
if(getBarState() == BARSTATE_NEWBAR){
var nh = high(0);
for(var i=0; i<20; ++i){
if(high(-i) > nh) nh = high(-i);
}
var sh = hhv(20,high());
var ah = highest(20,high());
return new Array(nh,sh.getValue(0),ah.getValue(0));
}
}
Comment