OPEN-SOURCE SCRIPT

MomentumBreak AI SwiftEdge

244
Momentumbreak AI SwiftEdge
Overview
This indicator combines two powerful concepts: Pivot Trendlines by HoanGhetti and the Squeeze Momentum Oscillator by AlgoAlpha. The goal of this mashup is to provide traders with a tool that identifies key trendline breakouts while simultaneously gauging market momentum through a dynamic gradient overlay. By integrating these two elements, the indicator offers a unique perspective on price action, helping traders spot high-probability breakout opportunities that align with momentum shifts.

How It Works
Pivot Trendlines:
The indicator uses HoanGhetti's Pivot Trendlines to identify pivot highs and lows based on user-defined settings (Pivot Length and Pivot Type).
Trendlines are drawn between these pivots, and breakouts are detected when the price crosses above (bullish) or below (bearish) the trendline.
Breakouts are visually highlighted with gradient boxes and an "AI: BREAK ⚡" label for clarity.
Squeeze Momentum Oscillator:
The Squeeze Momentum Oscillator calculates market momentum using a combination of volatility and price movement.
A dynamic midline (price_mid) is plotted, with its color indicating squeeze conditions (yellow for hypersqueeze, orange for normal squeeze, gray otherwise).
A gradient overlay is added above or below the midline to reflect momentum:
Green gradient for bullish momentum (vf > 0), placed below candles in an uptrend (close > price_mid) or above in a downtrend (close < price_mid).
Red gradient for bearish momentum (vf < 0), placed above candles in an uptrend or below in a downtrend.
The gradient's intensity increases as the price moves further from the midline, visually emphasizing momentum strength.
Breakout Confirmation:
Breakout signals are only generated when the momentum aligns with the breakout direction:
Bullish breakouts require bullish momentum (vf > 0).
Bearish breakouts require bearish momentum (vf < 0).
This alignment ensures that breakouts are more reliable and reduces false signals.
Default Settings
Pivot Length: 20 (determines the lookback period for identifying pivot points)
Pivot Type: Normal (can be set to "Fast" for more frequent pivots)
Repainting: True (trendlines may repaint as new pivots form; can be disabled)
Target Levels: False (optional horizontal levels at pivot points; can be enabled)
Extend: None (trendline extension; options: none, right, left, both)
Trendline Style: Dotted (options: dotted, dashed, solid)
Underlying Momentum Oscillator Length: 10
Swing Momentum Oscillator Length: 20
Squeeze Calculation Period: 14
Squeeze Smoothing Length: 7
Squeeze Detection Length: 14
Hyper Squeeze Detection Length: 5
Usage
This indicator is ideal for traders who want to combine trendline breakouts with momentum analysis:

Trendline Breakouts: Look for gradient boxes and "AI: BREAK ⚡" labels to identify confirmed breakouts. Bullish breakouts are marked with green boxes, and bearish breakouts with red boxes.
Momentum Confirmation: The gradient overlay (green for bullish, red for bearish) helps confirm the strength of the trend. Stronger gradients (less transparent) indicate stronger momentum.
Midline Crosses: Small triangles below (bullish) or above (bearish) candles indicate when the price crosses the dynamic midline, providing additional entry/exit signals.
Why This Combination?
The integration of Pivot Trendlines and Squeeze Momentum Oscillator creates a synergy that enhances trade decision-making:

Pivot Trendlines identify key structural levels in the market, making breakouts significant events.
The Squeeze Momentum Oscillator adds a momentum filter, ensuring that breakouts are supported by underlying market strength.
Together, they provide a more holistic view of price action, filtering out low-probability breakouts and highlighting opportunities where trendline breaks align with strong momentum.
Notes
This indicator does not use request.security() or barmerge.lookahead_on, so there is no risk of lookahead bias.
The script is designed to provide clear visual cues without making unrealistic claims about performance. It is intended as a tool for analysis, not a guaranteed trading system.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.