OPEN-SOURCE SCRIPT
Auto Trend Lines + Signals + Supertrend

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".
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".
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。