Announcement

Collapse
No announcement yet.

volume money flow indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • volume money flow indicator

    Can you help in the construction of the following indicator ?


    ============
    Construction: Twiggs Money Flow

    Twiggs Money Flow substitutes true range for the daily high and low and then applies exponential smoothing, separately, to the sum of AD and the divisor:

    Calculate True Range High and True Range Low:

    True Range High (TRH) is the greater of:
    High [today] and Closing price [yesterday]

    True Range Low (TRL) is the lesser of:
    Low [today] and Closing price [yesterday]

    Calculate AD using True Range High and True Range Low:

    AD = {(Close - TRL) - (TRH - Close)} / {TRH - TRL} * Volume


    Apply exponential smoothing* to AD:
    Calculate AD[21] as the sum of AD for the first 21 days
    On the next day, multiply AD[21] by 20/21 and add AD for day 22
    Repeat this process for each subsequent day**.

    *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 14-day exponential moving average.
    If you refer to Exponential Moving Averages you will see that this equates to a normal 27-day exponential moving average.

    Example
    Adjust Wilder's time period (n=15) to a normal EMA time period:

    EMA time period = (n + 1) / 2 = (15 + 1) / 2 = 8 days




    Do the same with the divisor:
    Calculate V[21] as the sum of volume for the same 21 day period as in 3. above
    On the next day, multiply V[21] by 20/21 and add Volume for day 22
    Repeat this process for each subsequent day

    **
    **Exponential Smoothing
    Some observant readers have questioned why Step 3 is not divided by 21 days, to create an exponential moving average. The same applies to Step 4.
    You will note that Step 5 divides the result of Step 3 by Step 4. Division of the numerator (Step 3) and the denominator (Step 4) by 21 is therefore redundant: the one offsets the other.

    This leads to another question: Why are AD (Step 3) and Volume (Step 4) not divided by 21?
    If we take Step 4 as an example, V[21] is the sum of 21 days of volume. If we want to add the next days Volume, we must remove one days Volume from V[21], to keep the total constant at 21 days. We do this by multiplying V[21] by the fraction 20/21.




    Divide AD[21] by V[21]:
    Twiggs Money Flow = AD[21] / V[21]


    more explanation:

  • #2
    To add

    This indicator should have a switch resets each day back to ZERO (as an option on/off)...

    Comment


    • #3
      Metastock code

      Maybe it can help !


      Here's simple Metastock code for "Twiggs Money Flow" indicator:

      {2003-09-24}
      periods:=Input("TMF periods",1,100,21);
      TRH:=Max(Ref(C,-1),H);
      TRL:=Min(Ref(C,-1),L);
      TR:=TRH-TRL;
      ADV:=((C-TRL)-(TRH-C))/If(TR=0,999999,TR)*V;
      WV:=V+(Ref(V,-1)*0);
      If(Wilders(WV,periods)=0,0,Wilders(ADV,periods)/Wilders(WV,periods))


      ===============

      Wilders indicator used by "Twiggs Money Flow" indicator:
      Wilders ATR From Equis

      {The actual ATR does not use a simple moving average. Welles Wilder uses
      his own smoothing (a modified exponential average) which is the function
      named "Wilders" in MetaStock. Try your formula this way:}

      periods:=Input("ATR Periods?",1,100,10);
      TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
      TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
      TR:=TH-TL;
      Wilders(TR,periods)


      {Equis Support}

      Notes:
      If (condition 1, condition2, condition 3) is for:
      If 1 then 2 else condition 3

      Ref(c,-1) is the close one bar ago

      Comment

      Working...
      X