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:
============
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:
Comment