Channel Lookback: Average Moving Price (CLAMP)
Jan 21, 2023

The Channel Lookback: Average Moving Price (CLAMP) indicator provides trade confirmation by comparing smoothed price changes across specific lookback periods to determine momentum and slope direction. By analyzing the relationship between price lookbacks and a zero-cross baseline channel, it identifies potential entry points based on the increasing or decreasing slope of a smoothed curve.
Usage
The Usage section describes how the script can be used to verify market direction and trend strength.
The indicator is primarily used as a confirmation tool rather than a standalone signal generator. It outputs three distinct visual cues:
- Green Triangle (Up): Indicates a long signal where the slope is increasing and the price lookback is trending upward.
- Red Triangle (Down): Indicates a short signal where the slope is decreasing and the price lookback is trending downward.
- Gray X (Neutral): Represents a no-trade or neutral zone where momentum is insufficient or contradictory.
Users can apply CLAMP to identify trend exhaustion or choppy market conditions. For example, during sideways price action, the indicator helps filter out false breakouts by requiring a slope change and smoothed momentum alignment before displaying a directional signal. In "Simple Mode," users can reduce visual noise by displaying only the final signal shapes.
Details
The CLAMP indicator operates by calculating the percentage change between the current closing price and the price $N$ periods ago. This raw change value is then smoothed using a selectable moving average (e.g., SMA, EMA, HMA).
To determine the trend's trajectory, the script calculates a secondary "Slope MA" derived from the smoothed results. It then measures the variance between this slope and its 3-period average. To provide context for these movements, the indicator plots two channels:
- Horizontal Baseline Channel: Centered around zero, with a width determined by the Average True Range (ATR) relative to price. This serves as a threshold for momentum.
- MA Channel: A dynamic channel that follows the slope of the smoothed lookback, providing a visual representation of momentum volatility.
Settings
- Lookback Settings
- MA Type: Selects the moving average method (None, EMA, HMA, RMA, SMA, SWMA, VWMA, WMA) used to smooth the initial price lookback.
- MA Length: Sets the period for the smoothing moving average.
- Periods: Determines the lookback distance (in bars) used to calculate the percentage price change.
- Slope Settings
- MA Type: Selects the moving average method used for calculating the slope of the smoothed change.
- MA Length: Sets the period for the slope-based moving average.
- MA Width (ATR%): Adjusts the scaling of the dynamic MA channel based on the current ATR.
- Channel Width (ATR%): Adjusts the scaling of the horizontal baseline channel based on the current ATR.
- General Settings
- Draw MA channel?: Toggles the visibility of the dynamic slope-based channel.
- Draw horizontal channel?: Toggles the visibility of the static baseline channel.
- Draw signal shape?: Toggles the visibility of the triangle and cross markers.
FAQ
How do I interpret the neutral signals? Neutral signals (gray crosses) occur when the slope and the smoothed price change do not align. These often indicate a lack of clear momentum or a potential transition phase in the market.
Which markets is this indicator best suited for? While configurable for many assets, the indicator is particularly effective in identifying reversals in choppy or mean-reverting environments. It should be backtested specifically for trending markets to ensure sensitivity matches the asset's volatility.
How can I access the Channel Lookback: Average Moving Price indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.