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

Notification

Icon
Error

Options
Go to last post Go to first unread
PeterR  
#1 Posted : Saturday, November 29, 2008 2:32:03 AM(UTC)
PeterR

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/28/2008(UTC)
Posts: 2


Hello,
My name is Peter, I am new to the forum and Metastock! can anyone help with some code please?

I need to do a Horizontal shift of "-1" on a moving average, I am loading 15 bars into an explore routine, but I need the moving average of the first 14 bars, code below.

Mov(VOLUME,15,SIMPLE)

((VOLUME - Mov(VOLUME,15,SIMPLE)) /
Mov(VOLUME,15,SIMPLE)) * 100

Thanks very much
henry1224  
#2 Posted : Saturday, November 29, 2008 6:18:59 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)

use the Ref function on your moving average

Ref(mov(V,15,S),-1)

this will shift the moving average to the left by one bar

Justin  
#3 Posted : Wednesday, December 3, 2008 11:21:34 AM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

Well just to be certain I understand, if you are wanting to shift an indicator to the left, you would use Ref +1. If you are wanting to shift the indicator to the right, you would use Ref -1
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.