NinjaTrader Divergence Indicator is designed to determine the well-known trading concept – divergence on the classic RSI, Stochastic and MACD technical analysis indicators.
A divergence forms on the chart when price movement begins to differ from the behavior of a technical indicator. In practice, this occurs when price continues to move in one direction while the underlying momentum measured by an oscillator starts to weaken or move differently.
Divergence analysis is widely used in discretionary trading, momentum analysis, and algorithmic trading strategies as a way to compare price structure with underlying momentum indicators.
Oscillators such as RSI, Stochastic, and MACD measure internal market momentum rather than price alone. When this internal momentum no longer confirms new highs or lows in price, a divergence pattern can emerge. This situation may highlight a temporary imbalance between price movement and the underlying momentum structure.
Because of this relationship between price and momentum, divergence patterns are widely studied in technical analysis as analytical structures that may precede changes in market behavior, including potential reversal phases or trend continuation scenarios depending on the broader market context.
It is important to note that divergence patterns do not predict future price movement. Instead, they highlight situations where price behavior and momentum temporarily diverge, which traders may use as an additional analytical reference within their broader market analysis.
The NinjaTrader Divergence Indicator detects divergence across three widely used oscillators — RSI, Stochastic, and MACD. The parameters of these indicators can be adjusted to suit different analytical preferences.
To ensure important divergence events are not overlooked, several types of alerts can be configured.
The indicator supports two divergence classifications — regular (classic) divergence and hidden divergence. If only one divergence type is required for analysis, the other can be disabled in the indicator settings.
The indicator visualises detected divergences in the form of lines connecting price extremes (price swing highs and lows), as well as entry triangles (pointers) that display the detected divergence direction on the chart.
Green triangles mark bullish divergence events, while red triangles mark bearish divergence events. Depending on the type of divergence – bearish or bullish – the lines are colored red or green.
Regular (classical) divergence is commonly interpreted as a structure that may precede a potential shift in market momentum.
Regular bullish divergence – price makes lower minimums and the oscillator makes higher minimums.
Regular bearish divergence – price makes a higher maximum and the oscillator makes a lower maximum.
They are displayed on the chart as solid lines.
Hidden divergence is commonly interpreted as a pattern that may occur during an ongoing sustained directional phase.
Hidden bullish divergence – price makes a higher minimum, but the oscillator makes a lower minimum.
Hidden bearish divergence – price makes a lower maximum and the oscillator makes a higher maximum.
They are displayed on the chart as dashed lines.
The indicator has the following parameters:
Alerts – setting up various types of alerts.
BaseIndicator – indicator selection for detecting divergences.
LookbackPoints – defines the lookback period during which a divergence may occur.
EnableClassicDivergences – enable/disable the detection of regular (classic) divergences.
EnableHiddenDivergences – enable/disable detection of hidden divergences.

We can customize this indicator to your needs — adding functions, modifying logic, or integrating it with other tools for your workflow.
We also convert indicators into Automated Trading Strategies with advanced functions (trailing stops, risk management, filters) tailored to your trading style strictly according to your specifications.
Request a free consultation to discuss the technical scope and timeline of your project.
We are committed to the ongoing development and refinement of our indicators. If you’ve spotted a bug, feel that something essential is missing, or have ideas that could make the indicator even better, just send us a message. Your feedback helps us improve and deliver tools that truly meet traders’ needs.
The indicator provides a set of exposed analytical plot outputs designed for structured integration with third-party strategy builders and automation tools such as BloodHound and BlackBird (SharkIndicators), as well as other algorithmic trading environments.
| Analytical Plot Name | Output Values | Description |
| Bearish | > 0 | Bearish directional detection condition |
| BearishHidden | > 0 | Bearish directional detection condition |
| Bullish | > 0 | Bullish directional detection condition |
| BullishHidden | > 0 | Bullish directional detection condition |
Plot output names and descriptions are technical identifiers intended solely for software integration purposes and do not constitute trading advice, signals, or recommendations.
Nordman Algorithms is a trade name of Nordman Algorithms OÜ (Reg. No. 14435535), registered in Tallinn, Estonia.
Software Nature & User Responsibility — Nordman Algorithms provides algorithmic software tools for technical analysis. Nordman Algorithms is not a financial advisor and is not liable for any losses. All trades conducted based on the software’s output are executed at the user’s sole discretion and risk.
Visual Markers & Signal Disclosure — This software may display visual markers (such as arrows, dots, or alerts) when predefined mathematical conditions are met. These markers are provided for educational and analytical purposes only, must not be interpreted as financial guidance, and do not constitute a recommendation to buy, sell, or hold any financial instrument. Users must independently validate all visual cues within their own trading methodology.
No Financial Advice — Nordman Algorithms does not provide discretionary trading signals, investment advice, or managed signal services. Our software represents a mathematical visualization of historical and real-time data. The appearance of a visual marker does not guarantee a profitable trade or predict future market behavior.
Trading Risk Warning — Futures, Forex, and options trading involve significant risk. Risk capital is money that can be lost without jeopardizing financial security. Only risk capital should be used for trading. Past performance is not indicative of future results. View Full Risk Disclosure: https://www.nordman-algorithms.com/risk-disclosure/
ESMA Risk Warning — Financial instruments, especially those involving leverage such as CFDs and Forex, are complex and carry a high risk of rapid financial loss. Our software provides analytical outputs and visual markers based on predefined mathematical conditions and does not mitigate or reduce inherent market risks. You should carefully consider whether you understand how leveraged financial instruments work and whether you can afford the high risk of losing your capital.
CFTC Rule 4.41 — Hypothetical or simulated performance results have inherent limitations. Unlike actual performance records, simulated results do not represent real trading. Because trades have not actually been executed, these results may under- or over-compensate for the impact of market factors such as liquidity. No representation is being made that any account will achieve profits or losses similar to those shown.
Trademark Notice — NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described herein, or any interest, ownership or otherwise, in any such product or service, or endorses, recommends or approves any such product or service.