[CT] Adaptive Trend Pressure (Percentile) Adaptive Trend Pressure (Percentile) is a centered, percentile-based trend and momentum pressure gauge designed to show you whether price is behaving more like it is pushing into the upper end of its recent distribution or slipping toward the lower end. Instead of using a fixed lookback oscillator formula, it builds an adaptive “range” from percentile bands that constantly adjust to the market’s recent behavior. That makes the reading more context-aware than many traditional oscillators, because the indicator is measuring where current price sits relative to an evolving statistical envelope rather than a static high/low window. The output is a pressure value that naturally expands when price action is persistently pressing toward the upper percentile band and contracts or turns negative when price is leaning toward the lower percentile band, which helps you read both direction and the quality of participation behind that direction.
The core engine starts by modeling a dynamic band around price using a volatility component. Volatility is measured with standard deviation over a short window, then scaled by a multiplier, and that volatility-adjusted value is added to and subtracted from the selected source to create an upper and lower “series.” Those two series are then run through a percentile calculation over the chosen trend length and sensitivity setting. The indicator finds the upper percentile of the upper series and the lower percentile of the lower series, creating an adaptive envelope that reflects both price location and recent volatility conditions. Once those percentile boundaries are established, the script converts the current source into a normalized oscillator by measuring how far it is between the lower and upper percentiles. That produces a bounded 0–100 reading that rises when price is persistently positioned near the top of the envelope and falls when price is positioned near the bottom, and it avoids distortions by protecting against division by extremely small ranges.
To make the output easier to trade, the indicator converts the 0–100 oscillator into a centered pressure line by subtracting 50. This creates a clean zero-line framework where positive pressure means the market is behaving with an upper-distribution bias and negative pressure means the market is behaving with a lower-distribution bias. The zero line becomes the primary regime divider and is intentionally simple to interpret in real time. When pressure stays above zero, you are generally seeing conditions consistent with bullish control, and when it stays below zero, you are generally seeing conditions consistent with bearish control. Because it is centered, you can also quickly judge the intensity of pressure by how far the histogram extends away from zero, which helps separate shallow drift from meaningful push.
A signal line is included and is computed as an EMA of the centered pressure value. This line is meant to smooth out the raw fluctuations and give you a second reference for timing and confirmation. When pressure is above the signal line, momentum is improving relative to its recent baseline, and when pressure is below the signal line, momentum is weakening. Crosses of pressure through the signal can be used as earlier timing cues, while the zero-line framework can be used as the higher-level bias filter. In practice, many traders will treat sustained pressure above zero as the directional environment and then use the signal relationship to help choose entries on pullbacks or to recognize when momentum is fading.
The indicator also includes optional zone guides that frame where “higher pressure” and “lower pressure” tend to become more meaningful. These zones are centered values, so the default upper zone corresponds to the same concept as an oscillator reading above roughly 75 on a 0–100 scale, and the default lower zone corresponds to roughly 25 on a 0–100 scale. When pressure pushes into the upper zone, it suggests the market is not only bullish-biased but doing so with stronger persistence, and when pressure pushes into the lower zone, it suggests stronger bearish persistence. The zone fill is a visual context rather than a standalone signal, and it is best used to identify when momentum is extended, when a trend is accelerating, or when mean-reversion risk may start rising, depending on your style.
By default, the plot is a histogram so you can read pressure as a “push” above or below zero. The histogram coloring can be enabled to make positive bars appear green and negative bars appear red, which reinforces the centered framework and keeps your attention on regime and intensity. If you prefer a cleaner look, you can switch to a line display while keeping the same calculations underneath. There is also an optional setting to color the actual price bars to match the histogram direction, which makes the bias visible on the main chart at a glance. When enabled, candles will adopt the bullish color when pressure is at or above zero and the bearish color when pressure is below zero, giving you a consistent visual alignment between the oscillator’s pressure state and the price action you are trading.
This tool is best used as a trend context and momentum pressure filter rather than a single, one-off trigger. In uptrends, you will often see pressure hold above zero with brief dips that fail to sustain below, and those dips commonly align with pullbacks that resolve back into the trend. In downtrends, pressure commonly holds below zero with brief rallies that fail to sustain above. The most important information is usually not the first cross, but whether the indicator can stay on the correct side of zero and how confidently it can push toward or into the upper or lower zone. When combined with your existing structure work, it can help you decide when to press trades in the direction of momentum and when to reduce risk as pressure fades or flips regime.
Pine Script® indicator






















