rarya 7 posts msg #66174  Ignore rarya 
8/14/2008 8:03:19 AM
http://www.incrediblecharts.com/technical/twiggs_money_flow.php
Can can anyone provide any insight in how to code up this indiciator.
Thanks

guru_trader 485 posts msg #66259  Ignore guru_trader modified 
8/16/2008 3:31:16 AM
This is basically it, according to the article ...
[edit: Formula A: ( [ (CTRL)  (TRHC) ] / TR ) * Volume ]
[edit: Formula B: [ (CTRL)  (TRHC) ] / (TR * Volume) ]
Note: I left out a few ifthen statements, but they didn't seem essential. Perhaps I'll have time to code those in later. The divergences are nice.

chetron 2,817 posts msg #66261  Ignore chetron 
8/16/2008 7:47:51 AM
hey guru,
tmf only comes in 2 flavors for me, 0 and 0. is this right?
also deno1 is always 999999. am i doing something wrong?
tia chetron

guru_trader 485 posts msg #66274  Ignore guru_trader modified 
8/16/2008 12:32:08 PM
I created another version of the TWF but that didn't match the "Metastock Formula" written on the website so I changed it up.
I do have a question about one part of the formula that is not clear ...
is it this? Formula A: ( [ (CTRL)  (TRHC) ] / TR ) * Volume
or this? Formula B: [ (CTRL)  (TRHC) ] / (TR * Volume)
the filter above was written in the style of Formula A, I'll post Formula B above also.
============================
From http://www.incrediblecharts.com/technical/twiggs_money_flow.php
MetaStock® Formula
{20030924}
periods:=Input("TMF periods",1,100,21);
TRH:=Max(Ref(C,1),H);
TRL:=Min(Ref(C,1),L);
TR:=TRHTRL;
ADV:=((CTRL)(TRHC))/If(TR=0,999999,TR)*V;
WV:=V+(Ref(V,1)*0);
If (Wilders(WV,periods) =0,0,Wilders(ADV,periods)/Wilders(WV,periods))
Line 6: WV
I have received several queries regarding line 6: WV:=V+(Ref(V,1)*0).
The first day for TRH and TRL is day #2 because the calculation requires Closing Price from the previous day. WV brings Volume into line with this, so that the first day of Volume used is day #2.
I received several emails from one reader who insisted that it makes no difference if you substitute V for WV in line 7. The difference is only noticeable in the first few months of data; it gradually fades with exponential smoothing.
============================

guru_trader 485 posts msg #66275  Ignore guru_trader modified 
8/16/2008 1:25:06 PM
Work in progress ... I revised the filter a little ...

guru_trader 485 posts msg #66278  Ignore guru_trader modified 
8/16/2008 3:19:11 PM
Here it is with a CEMA crossover ...

rarya 7 posts msg #66289  Ignore rarya modified 
8/16/2008 6:17:35 PM
Hey Guru,
Thanks for the input
this was my take on it, not as robust as yours
Also in your CEMA calculations you use 27. how does wilders EMA of 21 days relate to EMA of 27?
Thanks in Advance

guru_trader 485 posts msg #66290  Ignore guru_trader modified 
8/16/2008 6:23:52 PM
Apparently, Wilder's EMA(21) is equivalent to a regular EMA(27) according to the article you referred to ...
Source: http://www.incrediblecharts.com/technical/twiggs_money_flow.php
==============================================
*Welles Wilder's Indicators
TMF uses Welles Wilder's formula for calculating an exponential moving average:
1/14 of today's data + 13/14 of yesterday's average is a 14day exponential moving average.
If you refer to Exponential MA Time Periods you will see that this equates to a normal 27day exponential moving average.
Example
What Wilder's time period would equate to a normal EMA 15day time period:
Wilder's time period = (n + 1) / 2 = (15 + 1) / 2 = 8 days
==============================================

rarya 7 posts msg #66294  Ignore rarya modified 
8/16/2008 7:09:16 PM
I think 14 becomes 27
Wilders TP = (n+1)/2
(14*2)1 = n
I think 21 becomes 41
