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

Notification

Icon
Error

Options
Go to last post Go to first unread
Flexi  
#1 Posted : Tuesday, June 7, 2011 3:33:49 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

Below is a code for zigzag validity

How to make the code plot 1 representing valid to the next zigzag turn?

The current code plots 0 with price fall below x% even previously price has move x% and the current zigzag is valid

PerCha:=Input("Percent",0.1,100,10);
Plot:=Input("Result, 0=Validity, 1=Last Change (Th=-1, Pk=1)",0,1,0);

Zg:=Zig(C,PerCha,%);
CurZgPiv:=ValueWhen(1,( Zg > Ref(Zg,-1) AND Ref(Zg,-1) < Ref(Zg,-2) ) OR
( Zg < Ref(Zg,-1) AND Ref(Zg,-1) > Ref(Zg,-2) ),Ref(Zg,-1) );

PerChaDiff:=Abs( ( C - CurZgPiv ) / CurZgPiv * 100 );

SD:=( Zg > Ref(Zg,-1) AND Ref(Zg,-1) > Ref(Zg,-2) ) OR
(Zg < Ref(Zg,-1) AND Ref(Zg,-1) < Ref(Zg,-2) );

Valid:=If(PerChaDiff >= Percha ,1,0);
Validity:=If(Alert(Valid,2) AND SD,1,Valid);
CurPiv:=If( Zg > Ref(Zg,-1),1,-1);
If(Plot = 0,Validity,CurPiv);
Flexi  
#2 Posted : Tuesday, June 7, 2011 3:46:46 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

alernatively how to identify the first bar price making the current swing stable?
oztrader  
#3 Posted : Wednesday, June 8, 2011 7:06:39 AM(UTC)
oztrader

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 7/12/2007(UTC)
Posts: 134
Location: Perth Western Australia

Flexi wrote:
alernatively how to identify the first bar price making the current swing stable?
I have a solution to this request but whenever I try and post code that includes "greater than" or "less than" symbols I have a problem (see my last two test posts). Roy Larsen has also alluded to this problem. Is there something I am doing wrong or is the system stuffed.
Users browsing this topic
Guest (Hidden)
Similar Topics
ZigZag Validity doesn't appear in N Ticks Charts (Formula Assistance)
by Espartano 4/12/2019 2:37:12 PM(UTC)
ZigZag validity exploration (Formula Assistance)
by RUAGOODP 4/2/2006 1:12:51 AM(UTC)
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.