hi, i am a beginner of write custom efs. i want to get the adjusted newhigh, if not have new high, keep the pre value. How to get it? thanks very much.
some code like follows, but it doesn't work.
function main() {
var NH=0;
var HighPrice=0;
var ad=0;
HighPrice=hhv(20,high());
var ad=(close(0)-close(-1))/2;
if(getValue("high")<HighPrice(-1))
NH=LowPrice(-1)+ad(0);
return new array(getSeries(NH));
}
some code like follows, but it doesn't work.
function main() {
var NH=0;
var HighPrice=0;
var ad=0;
HighPrice=hhv(20,high());
var ad=(close(0)-close(-1))/2;
if(getValue("high")<HighPrice(-1))
NH=LowPrice(-1)+ad(0);
return new array(getSeries(NH));
}
Comment