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

Notification

Icon
Error

Options
Go to last post Go to first unread
m_armia  
#1 Posted : Sunday, December 4, 2011 3:16:00 AM(UTC)
m_armia

Rank: Newbie

Groups: Registered, Registered Users, Unverified Users
Joined: 10/10/2010(UTC)
Posts: 9

i created this system by zigzag
buy:
cross(Zig(c ,opt1 , %) , ref( Zig(c ,opt1 , %),-1))
sell:
cross(ref( Zig(c ,opt1 , %),-1),Zig(c ,opt1 , %))

it gives me a very good result in a tick data and i wrote it in the expert advisor when i attache this expert to the chart i found this problem:
sometimes it give me a signal (buy or sell) but after some bars it remove the given signal.
this make me confused if i take buy or sell signal then it remove it what i can do.

henry1224  
#2 Posted : Sunday, December 4, 2011 7:11:06 AM(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)
Zig Peak,Trough and Forward ref functions use hindsight to determine a signal. They are dynamic and should never be used in a system
m_armia  
#3 Posted : Monday, December 5, 2011 2:40:13 AM(UTC)
m_armia

Rank: Newbie

Groups: Registered, Registered Users, Unverified Users
Joined: 10/10/2010(UTC)
Posts: 9

Thanks ,
but where can i use this indicator to get benefit from it.
MS Support  
#4 Posted : Monday, December 5, 2011 12:10:46 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Zig Zag can be used for historical analysis, but not current signals since the last "leg" is not fixed.

Peak and Trough, while based on the Zig Zag, do not use the last "leg" They do not "see" a peak or trough until the prices have moved enough that the point is confirmed and not subject to change. Therefore, you could use the peak and trough functions to look back at a recent reversal to see how much prices have moved from that point or similar actions.
mstt  
#5 Posted : Monday, December 5, 2011 3:09:49 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi MS Support

Thank you, I've learned something new today, namely that Peak and Trough values do not change until the last leg has been confirmed.

However, this doesn't change the fact that Peak, Trough, PeakBars and TroughBars are dynamic - once the last leg has been confirmed these functions change their value for all bars back to the now confirmed peak or trough. So while they might have some value, I'm with Henry and believe they should never be used with mechanical systems. A signal that changes (other than on the hard right edge) renders any system it's used with impossible to back-test, and most likely very risky to trade.

Roy
jjstein  
#6 Posted : Monday, December 5, 2011 4:26:07 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Roy/MS Support -- Is there a way to tell when the "won't change anymore" point is reached?

If so, those functions could possibly be used -- with other Indicators -- for a backtest; ie: Use UNTIL the LastValue(Cum1) - HowEverManyBars point is reached, yes?

henry1224  
#7 Posted : Monday, December 5, 2011 5:22:19 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)
{ZigZag validity engine by Spyros Raftopoulos}
{additional code by Jose Silva}
{1=ZigZag valid, 0=ZigZag invalid}

perc:=Input("ZigZag percent",.1,100,5);
plot:=Input("plot: signals=1, % of valid signals=2, ZigZag=3",1,3,
1);
x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4);

x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
z:=Zig(x,perc,%);
z1:=Ref(z,-1);
z2:=Ref(z,-2);
last:=ValueWhen(1,z>z1 AND z1<z2
OR z<z1 AND z1>z2,z1);
pc:=Abs((x-last)*100/last);
SD:=z>z1 AND z1>z2 OR z<z1 AND z1<z2;
res:=pc>=perc;
valid:=If(Alert(res,2) AND SD,1,res);
validper:=Cum(valid)/Cum(valid>-1)*100;

If(plot=3,z,If(plot=2,validper,valid))
henry1224  
#8 Posted : Monday, December 5, 2011 5:23:49 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)
ZigZag Valid binary

{1 = valid, 0 = invalid}
perc:=Input("Percent",1,200,10);
Z:=Zig(C,perc,%);
last:=ValueWhen(1,( Z > Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2) )
OR ( Z < Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2) ), Ref(Z,-1) );
pc:=If(C > last, (C-last) * 100 / last, (last-C) * 100 / last);
pc:= Abs(pc);
cdBars:= BarsSince( (Z<Ref(Z,-1) AND Ref(Z,-1)>Ref(Z,-2) ) OR
(Z>Ref(Z,-1) AND Ref(Z,-1)<Ref(Z,-2) ));
ind:=If(pc>=perc,1,0);
indBars:= BarsSince(ind=1 AND Ref(ind,-1)=0);
If(indbars<cdBars,1,0);
henry1224  
#9 Posted : Monday, December 5, 2011 5:24:51 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)
ZigZag Targets

x:=Input("number of time periods in average",10,200,40);
x2:=x*2;
pd:=C-Mov(C,x,E);
hpd:=HHV(pd,x2);
lpd:=LLV(pd,x2);
nf:=200/(hpd-lpd);
((pd-lpd)*nf)-100
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.