Theory :
Based on the “Are You in A Trend” article by M.H.Pee :
TheĀ trend detection index (TDI) is used to detect when a trend has begun and when it has come to an end. The TDI can be used as a stand-alone indicator or combined with others; it will perform wellĀ inĀ detectingĀ theĀ beginningĀ of trends. However, this does not mean its signals are totally accurate. Protective stops as well as trailing stopsā must be incorporatedĀ toĀ produceĀ aĀ complete mechanicalĀ system.Ā TheseĀ stopsĀ are requiredĀ toĀ protectĀ againstĀ largeĀ lossesĀ whenĀ theĀ indicator generatesĀ aĀ losingĀ trade.Ā TheĀ T DI isĀ robust;Ā itĀ canĀ tradeĀ a diverseĀ portfolioĀ ofĀ marketsĀ profitablyĀ overĀ manyĀ years, using the same parameters throughout.
In this version we are adding smoothing option prior to using prices in the calculation. The lag added is small, hence the smoothing can help in filtering out some false signals
Usage :
You can use the color change as signal