Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/9/2005(UTC) Posts: 34 Location: Dallas, Texas, USA
|
Is there any way to calculate the average positive or negative rate of change in the price or percentage of a stock over a certain period of time? In other words, how would I write the code to calculate the average of the change in price when it is above its zero line or below its zero line? Additionally, how would I calculate the average time between those values?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
That's a lot of average you are talking about :D
Have you looked at my training videos :wink:
I only sell them for $1999 a piece :)
Quote: how would I write the code to calculate the average of the change in price when it is above its zero line or below its zero line?
{for 8 period average -Replace the 8's for something else}
Sum(Roc(C,1,$)>0,8)/8
Quote: Additionally, how would I calculate the average time between those values?
CD1:=Barssince(Roc(C,1,$)>0);
C1:=Cum(Roc(C,1,$)<0);
Cum(CD1)/C1
Or something kinda like that :smt017
Patrick :mrgreen:
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/10/2004(UTC) Posts: 863 Location: Salt Lake City, UT
|
Quote:I only sell them for $1999 a piece Smile
:smt075 Bad Patrick! gmb - you can have them for free... :)
http://forum.equis.com/viewforum.php?f=17
(yes - this was a sad excuse to use the stick emoticon... )
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/9/2005(UTC) Posts: 34 Location: Dallas, Texas, USA
|
Hey, I would love to learn to code better, but, in the meantime, I'll take all the help I can get. I already program simple .NET applications, but programming for Metastock is a little unusual since I have to think backwards rather than forwards.
One problem I have is that Metastock has all these great indicators built-in. So there's no way to customize them. I mean, really, who uses an MACD(12,26,9) exclusively ... I use all variations of the MACD to fit my trading styles. I have to customize almost all of the built-ins to work with my systems.
For $1999 you better be able to trade for me and make a decent profit at the same time! :lol:
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
:lol:
I hope it works for you. I will try to double check what I posted tomorrow.
|
|
|
|
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.