Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
michaelkalo wrote:I am trying to figure out an exploration that finds 2 MA moving in parallel to each other x days after a cross and specify a + or - angle. I have included an attachment of AEOS between Jan 2004 an Apr 2005 using a 20 & 50 SMA. I am hoping this would help find those stocks moving in a steady up or downward direction.
Try this:
pct:=Input("Error percentage",1,100,10);
x:=Input("Observation periods",1,20,7);
ma1:=Input("Fast MA period",1,252,20);
ma1:=ROC(Mov(C,ma1,S),1,%);
ma2:=Input("Slow MA period",1,252,50);
ma2:=ROC(Mov(C,ma2,S),1,%);
diff:=Abs(ma1-ma2)<(pct/100);
Sum(diff,x)=x;
BUT - notice you are introducing a lot of lag into this indicator! The 50 day MA has a large lag, the 20 day MA lags and now you lag each one of these by another (in this case) 7 seven bars!
Anyway, try it out... If it doesn't work, just reply back with a descripton of where it isn't working properly.
wabbit :D
|