OPEN-SOURCE SCRIPT
Actualizado

Constant Auto Trendlines (Extended Right)

1 042
📈 Constant Auto Trendlines (Extended Right)

This indicator automatically detects market structure by connecting swing highs and lows with permanent, forward-projecting trendlines.
Unlike standard trendline tools that stop at the last pivot, this version extends each trendline infinitely into the future — helping traders visualize where price may react next.

🔍 How It Works

The script identifies pivot highs and lows using user-defined left/right bar counts.
When a new lower high or higher low appears, the indicator draws a line between the two pivots and extends it forward using extend.right.
Each new confirmed trendline stays fixed, creating a historical map of structure that evolves naturally with market action.

Optional filters:

Min Slope – ignore nearly flat trendlines

Show Latest Only – focus on the most relevant trendline

Alerts – get notified when price crosses the most recent uptrend or downtrend line

🧩 Why It’s Useful

This tool helps traders:

Spot emerging trends early

Identify dynamic support/resistance diagonals

Avoid redrawing trendlines manually

Backtest structure breaks historically

⚙️ Inputs

Pivot Left / Right bars

Min slope threshold

Line color, width, and style

Show only latest line toggle

Alert options
Notas de prensa
🆕 Constant Auto Trendlines – Major Upgrade
Constant Auto Trendlines x5 (Extended Right) + Slope Labels

What’s new in this update:

✅ Proper Slope Engine

Slope is now calculated correctly as price units per bar using bar_index.

Much more consistent across symbols & timeframes.

📐 Slope Filter (Min Slope)

New input is in ticks per bar, not raw price.

Example: 1.0 = 1 tick per bar (very gentle filter).

Set to 0 to disable filtering and show all lines.

🏷 Slope Labels for Latest Lines

Optional labels on the most recent uptrend & downtrend lines.

Choose how slope is displayed:

Price/Bar

Degrees

ATR/Bar (slope normalised by volatility).

🧠 Cleaner Behaviour

Lines no longer “disappear” unexpectedly when you change Min Slope.

Trendline logic itself is unchanged – only the slope math & display got upgraded.

🎯 Multi-Set Version (x5)

New variant lets you run up to 5 independent trendline sets in one indicator.

Each set has its own:

Pivot Left / Right

Max Lines per side

Min Slope (ticks per bar)

Enable/Disable toggle

Perfect for mixing HTF structure, intraday levels & micro scalper lines without stacking lots of separate indicators.
Notas de prensa
✅ Quick Fix Update – Slope Label Stability Patch

Fixed a runtime error caused by slope labels referencing bar indices far in the past.

Slope labels now anchor safely at the current bar, eliminating “bar index too far” errors.

Cleaned up indentation + formatting to improve Pine stability.

No functional changes to the trendline logic — just a reliability improvement for users using slope labels.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.