OPEN-SOURCE SCRIPT

Auto Trend Lines + Signals + Supertrend

8 736
Auto Trend Lines + Signals + Supertrend — a TradingView indicator that combines three tools in one overlay.

Macro Trend
Detects significant pivot highs and lows using wide lookback windows (default: 10 bars left, 5 right). Connects consecutive lower highs into a resistance trendline (red) and higher lows into a support trendline (green). All lines accumulate on the chart, preserving the full history of trend levels. Options: wick or body pivots, log scale, forward extension, color and style.

Micro Trend
Same logic on a shorter scale (default: 4 left, 2 right) — catches smaller waves within the macro move. Drawn as dotted lines by default to distinguish them visually from macro lines.

Trendline Signals
When price crosses a trendline, a marker appears:

B (large, cyan) — Strong Buy: price broke above a macro resistance line
S (large, red) — Strong Sell: price broke below a macro support line
b (small, green) — Weak Buy: price broke above a micro resistance line
s (small, orange) — Weak Sell: price broke below a micro support line

Supertrend
Standard Supertrend based on ATR × multiplier. The line trails below price in an uptrend and above price in a downtrend, changing color on direction flips. Small circles mark each flip. Default settings: ATR period 10, multiplier 3.0 — both adjustable.

Alerts
Six individual alert conditions (Strong Buy, Strong Sell, Weak Buy, Weak Sell, ST Buy, ST Sell) plus two combined ones — "Any TL Signal" and "Any ST Signal".

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.