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

Notification

Icon
Error

Options
Go to last post Go to first unread
meridien  
#1 Posted : Monday, July 6, 2009 2:27:50 PM(UTC)
meridien

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/6/2009(UTC)
Posts: 8

Hello,

In the indicator builder I wish to create an indicator that would plot 1 if the 5-day average price > 5-day average price from the prior 5-day period and plot 0 if otherwise.

I am really having a hard time coding the exact above formula. If you guys know how to code it I would very much appreciate your help.

Cordially,

P.S: I know that it would be easier to use weekly data to code the above formula, but I really do need to know how to do it using daily data.

Justin  
#2 Posted : Monday, July 6, 2009 4:32:47 PM(UTC)
Justin

Rank: Advanced Member

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

Are you looking for a Weekly Moving Average (using Daily Data) or a 5-period Moving Average? A 5-period MA is quite simple to code:

Mov(C,5,S) > Ref(Mov(C,5,S),-5)
meridien  
#3 Posted : Monday, July 6, 2009 7:13:01 PM(UTC)
meridien

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/6/2009(UTC)
Posts: 8

Thank you so much I think this code will work. It is easy, but since I am a beginer...

I let you know if I have a problem with the code above.

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.