Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: aksh 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
|