thx Henry
i am aware of the dangers of using these functions for same-bar signals and am trying to use them only as help to determine pivot levels.
my initial attempt:
zzhigh:=input("ZZ Perc Top",1,10,3);
zzlow:=input("ZZ Perc Bot",1,10,3);
zztop:=zig(h,zzhigh,%);
zzbot:=zig(l,zzlow,%);
top:=ref(zztop<ref(zztop,-1) and ref(zztop,-1)>ref(zztop,-2),1);
bot:=ref(zzbot>ref(zzbot,-1) and ref(zzbot,-1)<ref(zzbot,-2),1);
plottop:=valuewhen(1,top=1,h);
plotbot:=valuewhen(1,bot=1,l);
plottop;plotbot;
As for an "adaptive zig" i tried substituting zztop and zzbot with the following:
zztop:=if(adx(12)<=15,zig(h,10,%),if(15<adx(12)<=25,zig(h,7,%),if(25<adx(12)<=35,zig(h,5,%),if(35<adx(12)<=45,zig(h,3,%),zig(h,2,%)))));
zzbot:=if(adx(12)<=15,zig(l,10,%),if(15<adx(12)<=25,zig(l,7,%),if(25<adx(12)<=35,zig(l,5,%),if(35<adx(12)<=45,zig(l,3,%),zig(h,2,%)))));
in terms of trading system, i would like to test breakouts, ie, LE when L>top and SE when H<bot...not sure about LX and SX and stops yet.
any ideas are welcome...thx