Hi! Fibotrader,
This is from a thread by karthikmarar, who is really good at what he does. The url of the the post is
http://www.traderji.com/technical-analysis/7377-experiments-technical-analysis-9.html
The post is at the bottom of the page. Am attaching the chart & the afl that Karthik has uploaded for your reference.
-----------------------------------------------------------------------------
Karthik's Post
I would like to share one such idea with you all. I often thought it would be a good thing if I can see the “trendiness” of the stock by just looking at the charts and not look through the ADX, DI+, RAVI or some complicated method. I could have an indication on the charts, may be a moving average, which can tell me if the market is moving sideways or is trending. Thus was born my Adaptive Moving average based “Trend Check Signal”.
This Moving average would follow the close price when the ADX value moving up. But when the ADX is down the moving average is clamped to a fixed level. In other words the moving average remains a straight line when the ADX is down indicating a sideways market. When the ADX is moving up, in other words the stock is trending up or even down the moving average tracks the price. Once this moving average is plotted in the price chart we have easily have an idea whether the market is trending or ranging by looking at this line.
We can even use the RAVI instead of ADX. RAVI reacts fasters than ADX.
I am enclosing a chart to show the Adaptive Moving Average, which I call “Trend Check”.
-----------------------------------------------------------------------------
Let us continue with the logic and codes for the Adaptive Moving Average based Trend Check.
For that we first look at the EMA formula briefly
EMA today = Sc ( C-EMA(-1))+EMA(-1)
Where Sc is the smoothing constant
C is today’s close
EMA(-1) is yesterdays EMA
SC is expressed as 2/(n+1) where n is the time period of the EMA.
In adaptive Moving average the Smoothing constant is changed based on other factors like volatility.
Here what we are trying to do is adjust the moving average based on the ADX or RAVI.
When the ADX/RAVI is above 20% of the recent range (Here last 20 days) the constant becomes equal to 2/(n+1). So the Moving average becomes equal to a EMA.
When the ADX/RAVI is below the 20% then the constant become equal to the ADX range value. Below 20% of the recent range means the
ADX/RAVI value is low and the constant tends towards zero and the EMA becomes equal to yesterdays value. This continues as long as the ADX/RAVI remain less than 20%. So the line becomes almost constant when the ADX/RAVI is below 20% of the recent 20 days range.
------------------------------------------------------------------------------
Would it be possible for you to please help the users of Fibotrader with the above. It would be really useful to us. As Karthik has suggested, RAVI would be preferable to the ADX.
Awaiting your reply ...
Thanks & regards,
Amit