Discussions
»
Product and Service Development
»
MetaStock
»
Please help to write metastock formula for the explorer
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!
|
|
|
|
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
|
|
|
|
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!
|
|
|
|
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.
|
|
|
|
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)
|
Discussions
»
Product and Service Development
»
MetaStock
»
Please help to write metastock formula for the explorer
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.