Discussions
»
Product and Service Development
»
Formula Assistance
»
HELP How to code: "If 5-day average price > 5-day average price from the prior 5-day period"
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.
|
|
|
|
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)
|
|
|
|
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)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
HELP How to code: "If 5-day average price > 5-day average price from the prior 5-day period"
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.