Gravity Trend Levels
Jun 1, 2026

The Gravity Trend Levels indicator is a momentum acceleration-based trend system that models directional gravity through the normalized rate of change of price velocity to produce adaptive cloud trails and structural fail levels. It dynamically adjusts trail distances based on whether gravitational pull is building or decaying, providing a visual representation of trend conviction rather than relying on fixed volatility multipliers.
Usage
The Usage section describes how the script can be used to identify trend transitions and momentum health. The tool provides several visual components to guide interpretation:
- Trend Identification: A bullish trend (Green) is established when price closes above the upper adaptive band. A bearish trend (Red) is established when price closes below the lower adaptive band.
- Gravity Cloud: The thickness of the cloud indicates trend strength. A thick cloud signifies strong gravitational pull (high acceleration), while a thinning cloud indicates gravity decay and potential trend exhaustion.
- Buy/Sell Signals: "B" and "S" labels mark the precise bar where the gravity trend state flips.
- Retest Diamonds: Small star markers (✦) appear when price interacts with the inner cloud boundary during an established trend, suggesting potential continuation or re-entry points.
- Gravity Fail Levels: Horizontal lines projected from the flip point serve as structural support or resistance, marking where the prior trend's momentum collapsed.
Details
The script operates by calculating price velocity and acceleration derived from an EMA baseline. This acceleration is normalized using Mean Absolute Deviation (MAD) to create a dimensionless "Gravity Score."
- Gravity Detection: When normalized acceleration exceeds a threshold, gravity increases; when it subsides, gravity decays exponentially.
- Adaptive Interpolation: The gravity score maps to a "Pull" value (0-1). This value interpolates the trail distance between a "Min" (tight) and "Max" (wide) setting. High gravity pulls the cloud closer to price, while low gravity allows it to expand.
- Fail Level Projection: Upon a trend reversal, the script identifies the high or low of the signal bar and projects it forward. This creates a historical record of structural "gravity collapses" that often act as significant price levels in the future.
Settings
Core Engine & Gravity Model
- Trend Length: Sets the EMA smoothing for the directional baseline.
- Gravity Lookback: The window used to calculate velocity. Lower values make the system more reactive to sudden acceleration.
- Gravity Decay: The rate at which gravitational pull dissipates. Higher values cause gravity to linger longer after momentum stalls.
- MAD Length: The lookback for Mean Absolute Deviation, used to normalize acceleration and scale the bands.
- Trail Min (Strong Pull): The multiplier for the bands when gravity is at its peak.
- Trail Max (Weak Pull): The multiplier for the bands when gravity has decayed.
Signals & Display
- Show Gravity Cloud: Toggles the visibility of the one-sided momentum cloud.
- Color Bars: Colors the price candles based on the active trend state (requires original candles to be disabled in chart settings).
- Show Buy/Sell Signals: Toggles the "B" and "S" labels on trend flips.
- Show Gravity Fail Levels: Enables the projection of horizontal structural levels from flip points.
- Retest Diamonds: Enables markers for price touches of the inner cloud.
- Signal Buffer Period: The number of bars to wait after a trend flip before retest diamonds can be detected.
- Retest Cooldown: Sets the minimum number of bars between consecutive retest diamonds to prevent signal overcrowding.
FAQ
How do I interpret a thinning Gravity Cloud? A thinning cloud suggests that price acceleration is slowing down and the "gravitational pull" of the current trend is decaying. This often precedes a trend reversal or a period of consolidation.
Why are the trend-colored candles not showing up correctly? For the "Color Bars" feature to display properly, you must disable the default candles in your charting platform's settings (right-click chart -> Settings -> Symbol -> Uncheck 'Body', 'Borders', and 'Wick').
How can I access the Gravity Trend Levels 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.