Trend Lines v2 is an automated support and resistance indicator, faithfully ported from LonesomeTheBlue's highly regarded Pine Script v4 algorithm. Optimized for the Indie 5 environment, it dynamically identifies market structure and draws precise, unbroken trend lines based on mathematical slope calculations rather than subjective visual approximations.

The indicator scans price action to pinpoint structural pivot highs and pivot lows based on a user-defined lookback period. It then evaluates the slope between historical pivots to project forward-looking trend lines. Crucially, the algorithm features a strict invalidation mechanism: if a candle's closing price breaks through a projected line, that trend is considered defeated and is automatically removed. This ensures your chart remains clean and displays only active, respected levels.
diff) to project forward geometry, guaranteeing strict algorithmic parity with the original logic.prd), the depth of historical pivot points to check (pp_num), and time-gated start dates.Use Cases
Comments