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

Notification

Icon
Error

Options
Go to last post Go to first unread
mohitdawar  
#1 Posted : Wednesday, March 4, 2009 1:20:09 PM(UTC)
mohitdawar

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/4/2009(UTC)
Posts: 1

pals,
i m quite new to using metastock, i need help for coding a formula

formula when price touches the exponential moving average
say price touches a 20 day ema
or price touches a 60 dat ena,

i may be sounding like a ass but plz help me, i really need this
wabbit  
#2 Posted : Wednesday, March 4, 2009 5:21:37 PM(UTC)
wabbit

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)
Hi mohitdawar,

Welcome to the forum.

The purpose of the forum is to assist people who are having trouble doing their own work in MS. Have a thorough read of the MS Users Manual and download the free Equis Formula Primer from the files section. These will give you the basics for writing your on MS functions, experts and explorations. Should you get stuck, you can always post your best attempt at the code on the forum, along with a full explanation of what you are trying to achieve and why your code is not achieving this, and someone will come to your aid.

There are also many, many posts containing codes which could already solve your problem. Do a search of the forum and see what comes up. Even if you don't find the exact answer, you might find something that's pretty close and can be edited to fulfil your specific requirements.


Hope this helps.

wabbit [:D]

johnl  
#3 Posted : Thursday, March 5, 2009 6:58:41 PM(UTC)
johnl

Rank: Advanced Member

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


By touch I guess you don't mean cross so a touch would be something like:

a1:=mov(C,20,E);
a2:=If((L<a1) and (H>a1) and (C>a1),1,0);
a3:=If((Ref(L,-1)>Ref(a1,-1)),1,0);
a2*a3


uasish  
#4 Posted : Saturday, March 7, 2009 10:26:08 PM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times

a2:=If((L<a1) and (H>a1) and (C>a1),1,0);


Just add '=' also,

a2:= If((L<= a1) and (H>= a1) and (C>a1),1,0);

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.