Dynamic Trendlines & Breakouts [identityKa]Overview
The Dynamic Trendlines & Breakouts is an automated structural analysis tool designed to remove human subjectivity from drawing trendlines. By utilizing mathematical pivot extremes, the script identifies the dominant market geometry in real-time. More importantly, it incorporates a Smart Volume Filter to distinguish between genuine structural breakouts and low-volume retail traps (fakeouts).
Core Engine Mechanics
The indicator operates on two primary algorithmic pillars:
Dynamic Coordinate Mapping: The script calculates the most recent pivot highs and pivot lows based on a user-defined lookback sensitivity. It then draws precision-extended dashed lines connecting these coordinates, forming dynamic Resistance (Upper Line) and Support (Lower Line) boundaries.
Volume-Confirmed Breakouts: The script continuously monitors the closing price relative to these extended lines. However, a crossover is not enough. If the "Volume Confirmation" feature is active, the engine checks a 20-period Simple Moving Average of the volume. A Bullish "B" (Buy) or Bearish "S" (Sell) label is only printed if the breakout candle is accompanied by above-average institutional volume, significantly increasing the probability of trend continuation.
HUD Dashboard & AI Proximity Logic
The integrated on-chart panel tracks the last confirmed breakout state and utilizes an ATR-based proximity sensor to generate the AI Suggestion:
Dangerous: Displayed actively whenever the current price is within a 0.5 Average True Range (ATR) distance of either the upper or lower trendline. This alerts the trader that the price is actively testing a major structural boundary, making new entries highly risky until a clear bounce or volume-confirmed breakout occurs.
LONG / SHORT: Triggered when the last structural breakout was Bullish (LONG) or Bearish (SHORT), provided the price is safely trending away from the immediate resistance/support lines.
How to Use It
This tool is ideal for momentum and breakout traders. When the price approaches a trendline (AI Suggestion reads "Dangerous"), prepare for a setup. Do not front-run the breakout. Wait for the engine to print the "B" or "S" label, confirming that both the structural level has been breached and the volume supports the move. Once confirmed, trade in the direction of the new momentum.
Pine Script® Indikator














