Skip to content
All library documents

Adaptive Narrow-Range Breakouts with Trend and Exit Filters

Article TradingView scripts

Summary

This indicator combines narrow-range patterns, inside bars, and breakout levels. It defines an N-bar range and flags a new narrow-range setup when that range is smaller than the prior ranges in a lookback window. Its inputs include a fixed NR2 setting and a 20-bar comparison window; inside-bar detection is optional. On a trigger, the script projects the pattern’s high and low forward and marks bullish or bearish breaks.

Trend filtering can require long triggers above a moving average and short triggers below it. The average can be static or adapt its length to the effective lookback, while the lookback itself can be fixed or adjusted using ADX, with stronger trend readings shortening the comparison window. Optional exit markers represent a target based on a multiple of the pattern’s height, a stop at the opposite edge of the pattern, or a time-based exit. These are indicator annotations rather than evidence of executable strategy performance. The document reports no performance tests, and the configurable filters and exits need evaluation across instruments and market conditions.

Key ideas

  • A narrow-range signal compares the current multi-bar range with ranges over a prior lookback window.
  • Inside-bar detection can be enabled alongside narrow-range pattern detection.
  • Breakout direction is filtered by price relative to a moving average, which can use static or adaptive length.
  • ADX can adapt the range lookback, making it shorter in stronger trends and longer in weaker conditions.
  • Optional markers illustrate target, stop, and time exits, but the document gives no strategy performance evidence.

Tags

Cited by

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.