Expert Advisor
You can change the values in Zig(CLOSE , 10 ,$ ) as per your
requirement
For Buy-
a:= Cross(CLOSE , Peak(1 , Zig(CLOSE , 10 ,$ ) , 0.001) ) ;
b:= Cross( Trough(1 , Zig(CLOSE , 10 , $) ,0.001 ) ,
CLOSE) ;
state:=If(BarsSince(a)<BarsSince(b),1,0);
state>Ref(state,-1)
For Sell
a:= Cross(CLOSE , Peak(1 , Zig(CLOSE , 10 ,$ ) , 0.001) ) ;
b:= Cross( Trough(1 , Zig(CLOSE , 10 , $) ,0.001 ) ,
CLOSE) ;
state:=If(BarsSince(a)<BarsSince(b),1,0);
state<Ref(state,-1)
Hitendra Vasudeo
www.stockmechanics.com
From:
equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx] On
Behalf Of Rob Tinley
Sent: Friday, June 19, 2009 4:52 PM
To: equismetastock@xxxxxxxxxxxxxxx
Subject: Re: [EquisMetaStock Group] zigzag help
Try using either Peak Value [Peak(Nth,Data Array,% Minimum
Change)] or Trough Value [Trough(Nth,Data Array,% Minimum Change)].
From your post you've obviously picked up on the inherent
dangers of using indicators that utilise the ZigZag function.
--- On Thu, 18/6/09, hailasarmale@xxxxxxxxx <hailasarmale@xxxxxxxxx>
wrote:
From: hailasarmale@xxxxxxxxx <hailasarmale@xxxxxxxxx>
Subject: [EquisMetaStock Group] zigzag help
To: equismetastock@xxxxxxxxxxxxxxx
Received: Thursday, 18 June, 2009, 6:22 PM
I'm new to this forum and to metastock programming .I
need a little help please .
This is what i'm trying to do :
- read values of the last 3 or 4 tops of a zigzag
indicator and average them .
- read values of the last 3 or 4 bottoms of the same indicator
and average them
( find an average magnitude )
- find distances between the last consecutive 8 tops and
bottoms and find an average wavelength
- generate a sinusoid using the average
magnitude/wavelengt h that I can extrapolate a little in the future .
BUT I want to ignore the last top/bottom that is
not yet confirmed .
Could someone help me please ?
|
|
Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how.
__._,_.___
__,_._,___