NinjaTrader Divergence Indicator

NinjaTrader Divergence Indicator
The NinjaTrader Divergence Indicator is designed to detect divergence patterns that may indicate changes in market dynamics, including potential shifts in momentum or sustained directional phases. The indicator determines the regular (classic) and hidden divergence calculated based on the RSI, Stochastic and MACD oscillators.

NinjaTrader Divergence Indicator

NinjaTrader Divergence Indicator is designed to determine the well-known trading concept – divergence on the classic RSI, Stochastic and MACD technical analysis indicators.

NinjaTrader Divergence Indicator

 

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.

 

How to interpret and use the NinjaTrader Divergence indicator?

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.

divergence cheatsheet

 

Regular (classical) divergence

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

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.

 

NinjaTrader Divergence indicator input parameters

The indicator has the following parameters:

NinjaTrader Divergence indicator input 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.

 

Custom Programming

mt4 custom programming

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 Value Your Feedback

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.

 

Exposed Analytical Plots for Strategy Builder Integration

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.

See other indicators on a single subscription
NinjaTrader TTM Squeeze Indicator
NinjaTrader Ichimoku Indicator
NinjaTrader SuperTrend Indicator