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

Notification

Icon
Error

Options
Go to last post Go to first unread
nakedkurt  
#1 Posted : Thursday, December 23, 2010 6:01:43 PM(UTC)
nakedkurt

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/23/2010(UTC)
Posts: 8

I wanna write metastock formula for the explorer of metastock with the following requirements:
(1) close price is larger than 3,5,8,10,12,15,30,35,40,45,50,60EMA and
(2) ADX is larger than 20 and DMI+ is higher than DMI- and
(3) MACD = or > 0

Please help! Many thanks!
johnl  
#2 Posted : Thursday, December 23, 2010 7:00:42 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

How about:


a1:=(C>Mov(C,3,E))*
(C>Mov(C,5,E))*
(C>Mov(C,8,E))*
(C>Mov(C,3,E))*
(C>Mov(C,10,E))*
(C>Mov(C,12,E))*
(C>Mov(C,15,E))*
(C>Mov(C,35,E))*
(C>Mov(C,40,E))*
(C>Mov(C,45,E))*
(C>Mov(C,50,E))*
(C>Mov(C,60,E));
a2:=(ADX(14)>20)*(PDI(14)>MDI(14));
a3:=MACD()>=0;
a4:=a1*a2*a3;
a4
nakedkurt  
#3 Posted : Monday, December 27, 2010 1:41:36 AM(UTC)
nakedkurt

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/23/2010(UTC)
Posts: 8

Thanks johnl, But I don't understand why using * for each end of the formulae? Would you mind telling me the reason? Many thanks!
emicros  
#4 Posted : Monday, December 27, 2010 5:23:24 PM(UTC)
emicros

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/22/2010(UTC)
Posts: 1

The C>mov() is a logical statement that returns 1 if the current price is greater than the moving average or it returns 0 if the price is less than or equal. So in order to evaluate all those moving averages if one is 0 then the entire muliplication will be 0.
johnl  
#5 Posted : Monday, December 27, 2010 8:12:34 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

I could have used "AND" instead of * and arrived at the same answer.
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.