OPEN-SOURCE SCRIPT

Linear Trajectory & Volume Structure

123
The Linear Trajectory & Volume Structure indicator is a comprehensive trend-following system designed to identify market direction, volatility-adjusted channels, and high-probability entry points. Unlike standard Moving Averages, this tool utilizes Linear Regression logic to calculate the "best fit" trajectory of price, encased within volatility bands (ATR) to filter out market noise.

It integrates three core analytical components into a single interface:

Trend Engine: A Linear Regression Curve to determine the mean trajectory.

Volume Verification: Filters signals to ensure price movement is backed by market participation.

Market Structure: Identifies previous high-volume supply and demand zones for support and resistance analysis.

2. Core Components and Logic

The Trajectory Engine

The backbone of the system is a Linear Regression calculation. This statistical method fits a straight line through recent price data points to determine the current slope and direction.

The Baseline: Represents the "fair value" or mean trajectory of the asset.

The Cloud: Calculated using Average True Range (ATR). It expands during high volatility and contracts during consolidation.

Trend Definition:

Bullish: Price breaks above the Upper Deviation Band.

Bearish: Price breaks below the Lower Deviation Band.

Neutral/Chop: Price remains inside the cloud.

Smart Volume Filter

The indicator includes a toggleable volume filter. When enabled, the script calculates a Simple Moving Average (SMA) of the volume.

High Volume: Current volume is greater than the Volume SMA.

Signal Validation: Reversal signals and structure zones are only generated if High Volume is present, reducing the likelihood of trading false breakouts on low liquidity.

Volume Structure (Smart Liquidity)

The script automatically plots Support (Demand) and Resistance (Supply) boxes based on pivot points.

Creation: A box is drawn only if a pivot high or low is formed with High Volume (if the volume filter is active).

Mitigation: The boxes extend to the right. If price breaks through a zone, the box turns gray to indicate the level has been breached.

3. Signal Guide

Trend Reversals (Buy/Sell Labels)

These are the primary signals indicating a potential change in the macro trend.

BUY Signal: Appears when price closes above the upper volatility band after previously being in a downtrend.

SELL Signal: Appears when price closes below the lower volatility band after previously being in an uptrend.

Pullbacks (Small Circles)

These are continuation signals, useful for adding to positions or entering an existing trend.

Long Pullback: The trend is Bullish, but price dips momentarily below the baseline (into the "discount" area) and closes back above it.

Short Pullback: The trend is Bearish, but price rallies momentarily above the baseline (into the "premium" area) and closes back below it.

4. Configuration and Settings

Trend Engine Settings

Trajectory Length: The lookback period for the Linear Regression. This is the most critical setting for tuning sensitivity.

Channel Multiplier: Controls the width of the cloud.

1.0: Aggressive. Results in narrower bands and earlier signals, but more false positives.

1.5: Balanced (Default).

2.0+: Conservative. Creates a wide channel, filtering out significant noise but delaying entry signals.

Signal Logic

Show Trend Reversals: Toggles the main Buy/Sell labels.

Show Pullbacks: Toggles the re-entry circle signals.

Smart Volume Filter: If checked, signals require above-average volume. Unchecking this yields more signals but removes the volume confirmation requirement.

Volume Structure

Show Smart Liquidity: Toggles the Support/Resistance boxes.

Structure Lookback: Defines how many bars constitute a pivot. Higher numbers identify only major market structures.

Max Active Zones: Limits the number of boxes on the chart to prevent clutter.

5. Timeframe Optimization Guide

To maximize the effectiveness of the Linear Trajectory, you must adjust the Trajectory Length input based on your trading style and timeframe.

Scalping (1-Minute to 5-Minute Charts)

Recommended Length: 20 to 30

Multiplier: 1.2 to 1.5

Logic: Fast-moving markets require a shorter lookback to react quickly to micro-trend changes.

Day Trading (15-Minute to 1-Hour Charts)

Recommended Length: 55 (Default)

Multiplier: 1.5

Logic: A balance between responsiveness and noise filtering. The default setting of 55 is standard for identifying intraday sessions.

Swing Trading (4-Hour to Daily Charts)

Recommended Length: 89 to 100

Multiplier: 1.8 to 2.0

Logic: Swing trading requires filtering out intraday noise. A longer length ensures you stay in the trade during minor retracements.

6. Dashboard (HUD) Interpretation

The Head-Up Display (HUD) provides a summary of the current market state without needing to analyze the chart visually.

Bias: Displays the current trend direction (BULLISH or BEARISH).

Momentum:

ACCELERATING: Price is moving away from the baseline (strong trend).

WEAKENING: Price is compressing toward the baseline (potential consolidation or reversal).

Volume: Indicates if the current candle's volume is HIGH or LOW relative to the average.

Disclaimer

*Trading cryptocurrencies, stocks, forex, and other financial instruments involves a high level of risk and may not be suitable for all investors. This indicator is a technical analysis tool provided for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a guarantee of profit. Past performance of any trading system or methodology is not necessarily indicative of future results.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.