logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
zigzag  
#1 Posted : Wednesday, October 27, 2010 11:33:02 AM(UTC)
zigzag

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/13/2009(UTC)
Posts: 42

Hello Metastockers

Has anyone ever come across a ZigZag function that accepts a variable value for its Percentage parameter? Any .dll? I have tried the Lastvalue(x+PREV*0) trick but it doesn't work. The concept I am trying to achieve here is to have a less sensitive (ie, higher percentage) ZigZag during weak trend phases (as measured by a "low" R-squared or ADX, etc) and a more sensitive one during strong trend phases. One possible way is to write several discrete pairs of Zig/ADX combinations and for each price bar display the Zig function according to that bar's value for ADX. But I am looking for a more continuous, general formula. Any other ideas?

Thanks.

ZZ

henry1224  
#2 Posted : Wednesday, October 27, 2010 1:10:30 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
ZZ,

The use of any peak, trough, or zigzag function results in hindsight or dynamic results.

When trying to get results for today's trading session, you will never see a trading signal.

The only advantage for these types of functions is to establish support and resistance levels

zigzag  
#3 Posted : Friday, October 29, 2010 12:24:04 PM(UTC)
zigzag

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/13/2009(UTC)
Posts: 42

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

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.