Trend Lines v2 (Indie Port)


Hidden Redirect Link
Loading...

Trend Lines v2

Overview

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.

Trend Lines v2 - Indie Script Port
Trend Lines v2 - Indie Script Port

How It Works

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.

Key Features

  • Automated Structural Analysis: Dynamically detects significant pivot highs and lows without the need for manual chart markup.
  • Smart Invalidation (Breakout Filtering): Automatically erases support and resistance lines that have been broken by a closing price, filtering out obsolete data.
  • Multi-Level Tracking: Simultaneously calculates and projects up to 3 active uptrend (support) and 3 downtrend (resistance) lines.
  • Mathematical Precision: Uses exact coordinate slope calculations (diff) to project forward geometry, guaranteeing strict algorithmic parity with the original logic.
  • Fully Customizable: Gives you complete control over pivot periods (prd), the depth of historical pivot points to check (pp_num), and time-gated start dates.

Use Cases

  • Identifying dynamic support and resistance zones for precise entry and exit targeting.
  • Trading breakout and breakdown strategies based on confirmed line invalidation.
  • Providing algorithmic confirmation to complement manual technical analysis.
© Licensed under MIT

Comments

loading