Intrabar Polarity Divergences

Jun 1, 2022

Static chart image
Price Action Based
Signals
Divergences

The Intrabar Polarity Divergences indicator analyzes lower timeframe data within a single higher timeframe candle to identify discrepancies between the bar's overall color and the directional dominance of its internal sub-bars. This tool helps traders identify potential exhaustion or hidden strength by revealing when the internal momentum of a candle contradicts its external appearance.

Usage

The Usage section focuses on identifying "Polarity Divergences." For example, a daily chart might display a green (bullish) candle, but the intrabar data may reveal that the majority of the lower timeframe bars were actually red (bearish).

  • Divergence Identification: When the majority direction of intrabars differs from the close-open direction of the main chart candle, the bar is highlighted with an orange background.
  • Percentage Labels: Labels appear above or below the bar showing the percentage of dominance for the opposing direction.
  • Absolute Values: If enabled, labels will also display the raw count of positive versus negative intrabars (e.g., 10/14).
  • Mid-Bar Price: A blue horizontal line can be plotted to represent the close price of the intrabar located exactly in the middle of the current candle's duration.

Details

The script utilizes the request.security_lower_tf function to fetch the direction (math.sign(close - open)) of every sub-bar within the current timeframe's bar. It calculates the sum of these directions to determine the true internal sentiment. A divergence occurs when the mathematical sign of the sum of intrabar directions is opposite to the sign of the current candle's price movement. This implementation allows for a more granular view of price action without manually switching timeframes.

Settings

  • Intrabar time frame: Determines the lower timeframe used for the internal analysis (e.g., looking at 5-minute bars inside a 1-hour candle).
  • Show actual positive/negative intrabar values: Toggles the display of the raw count of bullish and bearish sub-bars on the chart labels.
  • Show middle day intrabar close price: Enables or disables the blue plot representing the closing price of the median intrabar.

FAQ

How do I interpret an orange bar?

An orange bar indicates a polarity divergence, meaning the majority of the smaller timeframes within that bar moved in the opposite direction of the bar's final close.

Why are there no labels on some bars?

Labels only appear when a divergence is detected. If the internal intrabar momentum matches the external candle direction, no divergence is plotted.

How can I access Intrabar Polarity Divergences?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.