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

Notification

Icon
Error

Options
Go to last post Go to first unread
johnnic  
#1 Posted : Thursday, January 11, 2007 6:18:22 PM(UTC)
johnnic

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

SirShaveKWSN  
#2 Posted : Thursday, January 11, 2007 6:34:03 PM(UTC)
SirShaveKWSN

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 ...

johnnic  
#3 Posted : Thursday, January 11, 2007 6:44:40 PM(UTC)
johnnic

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/20/2006(UTC)
Posts: 21

thanks, that works.
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.