Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 11/20/2006(UTC) Posts: 21
|
As part of a system, I want to look for stocks that have not been below their 21 day SMA for the past 30 days. My question is how do I code this?
I know I could go through the tedious process of c>mov(c,21,s) and ref(c,-1) > ref(mov(c,21,s),-1), etc, etc but that would take forever and I'm sure there must be a better way. I haven't had any success in finding the answer in the Metastock manual (but assuming it can be done, it's obviously there).
Thanks
John
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 9/22/2006(UTC) Posts: 14
|
You could try something like this :
Test1:=Low<Mov(C,21,S);
Test2:=BarsSince(Test1)>=30;
And only proceed if Test2 is true ...
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 11/20/2006(UTC) Posts: 21
|
|
|
|
|
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.