Discussions
»
Special Interest Groups
»
MetaStock Developer's Kit (MDK) Assistance
»
Arithmetic Average in MFL who 'looks back', as well as 'looks forward'
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/5/2009(UTC) Posts: 18
|
Dear Metastock Users,
I've been trying for a month now to find out how to compute an arithmetic average in MFL, with no success. I've written to equis support to ask them if I need the MDK for this, but got no reply. I've asked on several forums, nothing I can use, so far.
I find it astonishing that none of the forum users has ever computed an arithmetic average of some values, for which the function needs to 'look back', as well as 'look forward'.
Example: I'm trying to compute a simple arithmetic average of the volume
corresponding to the minutes where we have a price inflection (closing
price different than closing price the previous minute). This would be
computed on a daily basis.
Let me describe this to you in some sort of pseudo-code:
Computing average for a certain day:
effectiveVolume = 0; n = 0; for every minute of today { is price != price of the minute before ?
if yes { effectiveVolume += volume traded this minute n++; } } averageVolume = effectiveVolume / n
Next, I'm gonna use the result computed with this function, in
another function. I'm gonna plot something depending on the volume
traded minute by minute. I'm gonna compare the volume of a certain
minute to this 'effective volume average' computed above. So i also need
a way to tell the above formula that I need the effective volume
average computed for 'today'.
Does it sound so impossibly complicated ?
PS If I was not very clear, please don't hesitate to ask.
|
|
|
|
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)
|
As I mentioned to you in an email -- I can do the task, but not at this busy time of the year and certainly not when I am about to relocate to the other side of the world!
wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/5/2009(UTC) Posts: 18
|
I was just trying to get this over with quicker, as it's been slowing me down in my learning process way too much [:(]
But don't worry, nobody can help anyway :)) So I guess I'll see you after you settle in. Good luck with everything!
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Special Interest Groups
»
MetaStock Developer's Kit (MDK) Assistance
»
Arithmetic Average in MFL who 'looks back', as well as 'looks forward'
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.