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

Notification

Icon
Error

Options
Go to last post Go to first unread
GeneralRC  
#1 Posted : Thursday, January 10, 2013 5:20:07 AM(UTC)
GeneralRC

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/10/2013(UTC)
Posts: 3

Hi All

Although new to Metastock, I've read through the programming language and don't seem to be getting the moving average programming right.

What I'm trying to do is compare the current day's close moving average (30-day) to the previous day's close moving average (30-day).

The theory being, you buy when the 30-day MA today is higher than the 30-day MA of yesterday.

My current formula is:

mov(close,30,exponential)>prev

This doesn't seem to give the right signals, in fact it generates buy signals when the MA is lower than previous.

Any ideas on how to correctly program this?

Many thanks! :D

mambapoker  
#2 Posted : Thursday, January 10, 2013 5:29:12 AM(UTC)
mambapoker

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/10/2013(UTC)
Posts: 4

mov(close,30,exponential)>ref(mov(close,30,exponential),-1)
GeneralRC  
#3 Posted : Thursday, January 10, 2013 3:17:17 PM(UTC)
GeneralRC

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/10/2013(UTC)
Posts: 3

mambapoker wrote:
mov(close,30,exponential)>ref(mov(close,30,exponential),-1)

Thanks Mambapoker! :D

wabbit  
#4 Posted : Thursday, January 10, 2013 4:09:35 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)
Work through the Equis Formula Primer to learn about how to use variables to stop doing the same computations more than once, using other functions such as ROC() to achieve this goal, and many, many other useful programming techniques.



wabbit [:D]

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.