PureBytes Links
Trading Reference Links
|
First I want to thank you all for your great interest in my work.
To Lionel Issen:
Lionel thanks you for your praising comments.
To Brian Sullivan and Marco"shineon":
Brian and Marco thank you for your compliments and your suggestions about
the article I am about to write.
To Jayson, Steve and ART:
Thank you for your comments and questions, which helped me and the rest of
us to clarify things about my indicator.
To Roy Larsen:
Thanks again Roy for your great interest and contribution.
Now back to ZigZag validity:
Roy located a problem, which is more obvious when one uses small percent
values (I tested with 3%) especially in choppy markets. The problem was that
validity dropped to zero each time zigzag changed direction, regardless of
what the %change was. Though both the Zigzag and the ZigZag validity
indicators, in my opinion, do not have much to offer in such markets, this
remark of Roy's was a very useful one because it gave me the chance to
correct this weak point and at the same time to make the code simpler.
So, here is the new version
{ZigZag validity by Spyros Raftopoulos}
perc:=Input("Percent",2,100,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:=(C-last) * 100 / last;
pc:= Abs(pc);
SD:=(z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2)) OR (z<Ref(z,-1) AND
Ref(z,-1)<Ref(z,-2));
res:=If(pc>=perc ,1,0);
If(Alert(res,2) AND SD,1,res);
If any of you encounter any other problems please let me know.
Happy trading
Spyros
----- Original Message -----
From: <drc1939@xxxxxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Sunday, March 03, 2002 1:27 AM
Subject: Re: ZigZag validity Expert
> Spyros. I think the expert needs an indicator called "ZigZag Validity".
Can you let us have the formula? Thanks.
> >
> > From: "SR" <raftsp@xxxxxxxxx>
> > Date: Sat, 2 Mar 2002 11:01:11 +0200
> > To: <metastock@xxxxxxxxxxxxxxxxxx>
> > Subject: ZigZag validity Expert
> >
> >
> > Since there are many users who showed interest in my indicator, I
provide
> > here the code for a complete Expert. It uses Trends, Highlights,
Symbols,
> > Alerts and a simple Commentary.
> > ______________________________________________________
> >
> > New Expert for ZigZag validity
> >
> > Name: ZigZag validity
> >
> > ------------------------------------------------------
> >
> > Trends
> >
> > Bullish:
> > Zig(CLOSE ,10 ,% ) > Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1
> >
> > Bearish:
> > Zig(CLOSE ,10 ,% ) < Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1
> >
> > ------------------------------------------------------
> >
> > Highlights (the code is the same as above)
> >
> > Name: UpTrend confirmed
> > Color: Green or Dk Green
> > Condition:
> > Zig(CLOSE ,10 ,% ) > Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1
> >
> > Name: DownTrend confirmed
> > Color: Red
> > Condition:
> > Zig(CLOSE ,10 ,% ) < Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1
> >
> > ------------------------------------------------------
> >
> > Symbols (there are 3 symbols)
> >
> > Name: Zig invalid
> > Graphic: ? (question mark)
> > Color : Black
> > Condition :
> > Cross(0.5, Fml("ZigZag validity"))
> >
> > Name: UpTrend confirmed
> > Graphic: Thumbs Up
> > Color : Green or Dk Green
> > Condition :
> > cond:=
> > Zig(CLOSE ,10 ,% ) > Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1;
> > Cross(cond,0.5)
> >
> > Name: DownTrend confirmed
> > Graphic: Thumbs Down
> > Color : Red
> > Condition :
> > cond:=
> > Zig(CLOSE ,10 ,% ) < Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1;
> > Cross(cond,0.5)
> >
> > ------------------------------------------------------
> >
> > Alerts (there are 3 alerts using the same code as the Symbols section)
> >
> > Name: Zig invalid
> > Alert : Zig is invalid here
> > Condition:
> > Cross(0.5,Fml("ZigZag validity"))
> >
> > Name: UpTrend confirmed
> > Alert : Up trend confirmed
> > Condition :
> > cond:=
> > Zig(CLOSE ,10 ,% ) > Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1;
> > Cross(cond,0.5)
> >
> > Name: DownTrend confirmed
> > Alert : Down trend confirmed
> > Condition :
> > cond:=
> > Zig(CLOSE ,10 ,% ) < Ref(Zig(CLOSE ,10 ,% ),-1)
> > AND Fml("ZigZag validity") = 1;
> > Cross(cond,0.5)
> >
> > ------------------------------------------------------
> >
> > Commentary
> >
> > <expert>
> > by Spyros Raftopoulos
> >
> > Review of <name> (<symbol>)
> > <date>
> > ------------------------------------------
> >
> > Zig(Close,10,% ): writeval(Zig(Close,10,% ),8.2)
> >
> > writeif(Zig(Close,10,% )>ref(Zig(Close,10,% ),-1), "The ZigZag indicator
is
> > ascending which means that prices are moving up.", "Prices move downward
as
> > shown by the descending ZigZag indicator. ")
> > writeif(fml("ZigZag validity")=1, "This trend is confirmed by the ZigZag
> > validity indicator. Zig Zag has been valid for
> > writeval(barssince(cross(fml("ZigZag validity"),0.5)), 3.0) bars.",
> > "However, the trend is not confirmed yet. Zig Zag has been invalid for
> > writeval(barssince(cross(0.5,fml("ZigZag validity"))), 3.0) bars.")
> >
> > ___________________________________________
> >
> > The above tools are very similar: Alerts coincide with Symbols and
> > Highlights coincide with Trends.
> > Therefore you may not need all of them at the same time.
> > Remember that, at any time, you can activate or deactivate any of the
above
> > by clicking on the corresponding check box(es).
> >
> > I hope this helps. In any case please drop me a note.
> > If there are any more problems also let me know.
> >
> > Cheers
> > Spyros
> >
> > ____________________________________________
> >
> >
>
>
>
|