PROTECTED SOURCE SCRIPT

Trend Indicator for Directional Trading (add-on)

Updated
TIDT is a two-part trend-based indicator designed to recognize the general direction and help you identify good opportunities for going long or short (both indicators are called the same way with "main" and "add-on" additions).

This is the add-on indicator that is added below the chart and aside from identifying trending opportunities, it also shows Bullish and Bearish Divergences. Similar to the main indicator, it is based on 3 Moving Averages over which you have full control. You can choose between the following 7 types:

- Simple Moving Average ( SMA )
- Exponential Moving Average ( EMA )
- Weighted Moving Average ( WMA )
- Running Moving Average (RMA)
- Hull Moving Average ( HMA )
- Volume Weighted Moving Average ( VWMA )
- Arnaud Legoux Moving Average ( ALMA )

I strongly suggest that the types and periods for your MAs in the main and the add-on versions are identical so that you get a better visual of the whole picture. However, you may develop a trading strategy that relies on two different types of signals, so that's entirely up to you. Once you have set up the MAs and chosen the lookback period, the rest is taken care of for you. You get two types of signals:

1) Pullbacks - the divergences between your MAs generate a result, which is then averaged as a percentage gain or loss and worked out into a histogram. The colors of the histogram indicate opportunities to buy (if green), short (if red), or sit tight (if white) unless an explicit signal is given by the indicator. Overall the principle is simple - establish the trend and look for weaknesses so that you can open an order in the direction of the trend.

2) Divergences - generated in a similar way to the Pullbacks strategy with some minor adjustments and improvements to better catch the divergences. The histogram is slightly different, as the positive results are plotted above 0 and the negative ones below 0. As such, the histogram looks a lot like MACD, but with different calculations. The color principle mentioned above is the same - green for longs, red for shorts, and white for neutral unless specified by a signal. The change of the shade of the color shows an increase or a decrease in the momentum. A Long signal comes up when the price makes a lower low, while the momentum makes a higher low. A Short signal comes up when the price makes a higher high, but the momentum makes a lower high.

Ticking a box next to the signal type will show the associated histogram and its signals. Due to the different ways those two histograms are calculated and displayed I recommend having either of them On, but not both. However, you may want to be able to see both types of signals, so I've left this as an option. Once again, all colors are fully configurable.

The complete Trend Indicator for Directional Trading has gone over 1,500 revisions, has been forked over 10 times, and has been worked out to be as minimalistic, useful, and practical as possible. A great deal of work, time, and experience have been poured into this indicator to do what it's supposed to do - help you identify better entry opportunities for increased profitability.

If you have any questions regarding the indicator or suggestions on how it could be improved, please let me know. Thank you.
Release Notes
A slight modification in the way Bear and Bull Pullbacks are calculated. In the previous version, an entry was given when momentum was accelerating, which was sometimes causing a bit of a delay.

In the new version, the indicator signals before acceleration occur. This should give you a slight advantage due to a signal coming up earlier.
Release Notes
A thorough update of the indicator, which includes:
- cleaner code (this doesn't really concern you, but makes it easier for future updates)
- some unnecessary features are removed, such as the Lookback period (code is optimized not to use it)
- histogram now shows above and below 0 depending on the trend. It turned out that a 0-100 scale was more confusing than the initially implemented histogram.
- divergence histogram removed (it's all in one now)
- Pullback and Divergence strategies are now optimized

I also feel the need to do a more simplistic explanation of how to use the indicator, as the one above seems to have been too confusing for some of you. So here we go.

The parameters you can tweak in the indicator are 3 Moving Averages. To get a visual of them use the "Trend Indicator for Directional Trading (main)" which was developed alongside this one, or if you prefer, you can use the leaner version which is Multiple Time Frames Moving Averages (x3).

Once you set up your MAs, the pullback strategy generates a histogram that measures the convergence/divergence between MA1 and MA2. MA3 is used for a major trend, so make sure you use a smoother, longer one such as 150 SMA or maybe 100 RMA. The indicator will give you a Pullback signal when the price makes a slight pullback against the main trend (again, determined by your MA3).

In terms of the Divergence signals, they are pretty straightforward - when price makes higher high, but the histogram peaks diverge (make lower high), then you get Bearish Divergence. When the price makes a lower low, but the Histogram diverges and makes a higher low, then you get Bullish Divergence.

Bear in mind that the look of the histogram and the signals you get will depend largely on the Moving Averages you implement and their periods. More volatile assets will require faster MAs such as TEMA or HMA, while more stable assets may require slower MAs, such as SMA or RMA.

I hope this is a clearer description of the indicator and you can make more use of it. Let me know if you have any questions or suggestions. Thanks.
Release Notes
The updated version includes:
✔️ Simplified user interface
✔️ Code update to comply with the new TradingView color requirements
✔️ Some minor modifications in the formulas
DivergencedivergencetradingMoving AveragesOscillatorstrendTrend Analysistrendfollowingtrendreversaltrendstrendspottertrendtrading

Protected script

This script is published closed-source and you may privately use it freely.

Want to use this script on a chart?


Also on:

Disclaimer