A very common request I receive for is to program a Divergence Indicator. While divergence is easy for the eyes to see, it can be difficult to define in programmable terms. As a result, I often found myself spending more time working with customers to define divergence than I did programming their indicator. Additionally, more often than not the definitions we ended up with were very simplistic, and do not do a good job finding divergences.
As a result, I decided to create my own Divergence Indicator using my proprietary rules. The Divergence Indicator utilizes a sophisticated algorithm to detect divergence, and eliminates some shortcomings of typical divergence indicators. I have seen and worked with a lot of Divergence Indicators. Coincidentally, I have not seen one that will find even half as many Divergence patterns as this one. Additionally, it can be calculated using ANY indicator that you have in NinjaTrader (ex. RSI, MACD, Stochastic, or any custom indicators). Also, it works with the Market Analyzer window, and is fully compatible with BloodHound.
What is Divergence?
The simple definition of divergence is when price is moving in the opposite direction of an indicator. Typically, divergence is calculated using an oscillator indicator. Some common indicators used to detect divergence include the MACD, RSI, and Stochastics. The image in Figure A shows an example of divergence using the MACD, which is the blue line in the bottom panel of the chart. As you can see, the Divergence Indicator has drawn lines on the price chart connecting lower highs in price. Similarly, the indicator has drawn a line on the MACD chart connecting higher highs. Since price is making lower highs, and the indicator is making higher highs, we have divergence!
Types of Divergence:
- Price is making higher highs while indicator is making lower highs.
- Price is making lower lows while indicator is making higher lows.
- Price is making lower highs while indicator is making higher highs.
- Price is making higher lows while indicator is making lower lows.
My NinjaTrader Divergence Indicator will detect all types of divergence listed above. Each type is plotted using color coded lines, while allows you to easily identify different types of divergence.