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

Notification

Icon
Error

Options
Go to last post Go to first unread
aksh  
#1 Posted : Wednesday, January 31, 2018 2:40:33 PM(UTC)
aksh

Rank: Member

Groups: Registered, Registered Users
Joined: 1/20/2007(UTC)
Posts: 15

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

Hi all,

The "Money Flow Index" formula under "Custom Formula Collection" on page https://www.metastock.com/customer/resources/formulas/?id=40 and given below doesn't match the Equis MetaStock built-in indicator. It doesn't plot properly as an overbought/oversold indicator. It shows spikes when plotted.

{Doesn't match the MetaStock built-in indicator} Periods:=Input( "Periods", 2, 252, 14); up:=Sum(If(Typ(),>,Ref(Typ(),-1), V * Typ(), 0), Periods); dn:=Sum(If(Typ(),<,Ref(Typ(),-1), -1 * V * Typ(), 0), Periods); (100 - (100 / (1 + up / dn ))); 80;20

I was playing with the above formula, making some changes to it and accidentally discovered the following formula. The following indicator matches the MetaStock built-in indicator exactly. There is however a slight difference in the initial periods where it takes a dip from the overbought to the oversold area. I don't know whether the formula below is given in the MetaStock manual or the formula primer or the metastock forum; I couldn't find it anywhere.

{Matches MetaStock built-in indicator} Periods:=Input( "Periods", 2, 252, 14); up:=Sum(If(Typ(),>,Ref(Typ(),-1), V*Typ()-Ref(Typ(),-1), 0), Periods); dn:=Sum(If(Typ(),<,Ref(Typ(),-1), Ref(Typ(),-1) - (-1 * V * Typ()), 0), Periods); (100 - (100 / (1 + up / dn))); 80;20

Regards

Arun

thanks 1 user thanked aksh for this useful post.
MS Support on 2/2/2018(UTC)
MS Support  
#2 Posted : Friday, February 2, 2018 9:07:16 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,420

Thanks: 35 times
Was thanked: 110 time(s) in 106 post(s)
Originally Posted by: aksh Go to Quoted Post

Hi all,

The "Money Flow Index" formula under "Custom Formula Collection" on page https://www.metastock.com/customer/resources/formulas/?id=40 and given below doesn't match the Equis MetaStock built-in indicator. It doesn't plot properly as an overbought/oversold indicator. It shows spikes when plotted.

{Doesn't match the MetaStock built-in indicator} Periods:=Input( "Periods", 2, 252, 14); up:=Sum(If(Typ(),>,Ref(Typ(),-1), V * Typ(), 0), Periods); dn:=Sum(If(Typ(),<,Ref(Typ(),-1), -1 * V * Typ(), 0), Periods); (100 - (100 / (1 + up / dn ))); 80;20

I was playing with the above formula, making some changes to it and accidentally discovered the following formula. The following indicator matches the MetaStock built-in indicator exactly. There is however a slight difference in the initial periods where it takes a dip from the overbought to the oversold area. I don't know whether the formula below is given in the MetaStock manual or the formula primer or the metastock forum; I couldn't find it anywhere.

{Matches MetaStock built-in indicator} Periods:=Input( "Periods", 2, 252, 14); up:=Sum(If(Typ(),>,Ref(Typ(),-1), V*Typ()-Ref(Typ(),-1), 0), Periods); dn:=Sum(If(Typ(),<,Ref(Typ(),-1), Ref(Typ(),-1) - (-1 * V * Typ()), 0), Periods); (100 - (100 / (1 + up / dn))); 80;20

Regards

Arun

Hi,

I don't believe we wrote that particular TASC formula (the Sidebar formulas were typically written by the article author) but I do believe the problem is in the " * -1 " aspect of the "Negative Money Flow". Perhaps the author believed the numerical value needed to be made negative (vs. summing the "negative" or down days) but if you simply remove the * -1 from the original Negative Money Flow formula you should also resolve the problem.

Here is a Combined / Modified version of the one on the web that should match the built-in Money Flow Index.

Code:
PERIODS:=Input("Money Flow Periods",2,252,14);
PMF:=Sum(If(Typ(),>,Ref(Typ(),-1),V*Typ(),0),PERIODS);
NMF:=Sum(If(Typ(),<,Ref(Typ(),-1),V*Typ(),0),PERIODS);
MFR:=PMF/NMF;
MFIdx:=100-(100/(1+MFR));
MFIdx

aksh  
#3 Posted : Saturday, February 3, 2018 6:44:24 AM(UTC)
aksh

Rank: Member

Groups: Registered, Registered Users
Joined: 1/20/2007(UTC)
Posts: 15

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

Yes, that is the correct code. Matches the built-in indicator perfectly. 

I had subtracted price from price*volume and vice versa, which doesn't make sense.

Thanks.

Edited by user Saturday, February 3, 2018 6:45:34 AM(UTC)  | Reason: Not specified

Users browsing this topic
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.