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
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 1/10/2013(UTC) Posts: 4
|
mov(close,30,exponential)>ref(mov(close,30,exponential),-1)
|
|
|
|
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
|
|
|
|
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.