OPEN-SOURCE SCRIPT
[KTY] Auto Trendlines

[KTY] Auto Trendlines
Automatically detects and draws diagonal trendlines
based on pivot highs and lows.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔑 Key Features
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Auto Trendline Detection
Scans recent price action and plots dynamic trendlines
that adapt to ongoing market structure.
Bullish (Green): Connects ascending lows — acts as dynamic support
Bearish (Red): Connects descending highs — acts as dynamic resistance
Each trendline includes a soft glow background
for clearer visual weight.
Confirmed segments are drawn solid,
while projected extensions appear dotted.
✅ Multi-Length System
Two independent trendline groups (L1, L2) run simultaneously,
allowing you to track short-term and longer-term trends
on the same chart.
✅ Smart Anchor Replacement
Trendline starting points are automatically refined
to prevent the line from cutting through candles,
producing cleaner and more reliable trendlines.
✅ Angle Filter
Filters out trendlines that are too flat or too steep,
removing noise and keeping only meaningful structures.
Optional angle labels can be enabled in Debug mode
to help you fine-tune the filter range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 How to Use
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1️⃣ Bounce off bullish trendline → higher chance of trend continuation
2️⃣ Rejection at bearish trendline → higher chance of downward move
3️⃣ Trendline break → potential trend reversal or shift in structure
🔄 Trendline Break
- Broken bullish trendline may signal weakening uptrend
- Broken bearish trendline may signal weakening downtrend
- Watch for retest of the broken trendline before entering
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Trendlines
- Show Trendlines: Toggle visibility on/off
- Bullish Color: Customize bullish trendline color (default: green)
- Bearish Color: Customize bearish trendline color (default: red)
🧪 Lengths
- Show L1 / Length 1: Toggle and set short-term pivot length
- Show L2 / Length 2: Toggle and set longer-term pivot length
🎯 Detection
- Anchor Replacement: Refines trendline start points for cleaner lines
- Future Extension Bars: Length of the projected (dotted) extension
- Break Bars Limit: How long broken trendlines remain on the chart
📐 Angle Filter
- Use Angle Filter: Toggle filtering of flat/steep trendlines
- Min Angle / Max Angle: Allowed angle range for valid trendlines
🐞 Debug
- Show Angle Label: Display the angle (°) at each trendline's start point,
useful when adjusting the angle filter range
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alerts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🟢 Bullish Trendline Break: Triggers when price closes below a bullish trendline
🔴 Bearish Trendline Break: Triggers when price closes above a bearish trendline
⚡ Any Trendline Break: Triggers on any trendline break event
Setup: ALT + A → Select 【Auto Trendlines】→ Create alert
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Disclaimer
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is an analysis tool, not a trade signal service.
Based on historical pivot data — does not guarantee future price reactions.
Strong trends or sudden volatility may invalidate trendlines.
All trading decisions and associated risks are solely your responsibility.
Automatically detects and draws diagonal trendlines
based on pivot highs and lows.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔑 Key Features
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Auto Trendline Detection
Scans recent price action and plots dynamic trendlines
that adapt to ongoing market structure.
Bullish (Green): Connects ascending lows — acts as dynamic support
Bearish (Red): Connects descending highs — acts as dynamic resistance
Each trendline includes a soft glow background
for clearer visual weight.
Confirmed segments are drawn solid,
while projected extensions appear dotted.
✅ Multi-Length System
Two independent trendline groups (L1, L2) run simultaneously,
allowing you to track short-term and longer-term trends
on the same chart.
✅ Smart Anchor Replacement
Trendline starting points are automatically refined
to prevent the line from cutting through candles,
producing cleaner and more reliable trendlines.
✅ Angle Filter
Filters out trendlines that are too flat or too steep,
removing noise and keeping only meaningful structures.
Optional angle labels can be enabled in Debug mode
to help you fine-tune the filter range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 How to Use
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1️⃣ Bounce off bullish trendline → higher chance of trend continuation
2️⃣ Rejection at bearish trendline → higher chance of downward move
3️⃣ Trendline break → potential trend reversal or shift in structure
🔄 Trendline Break
- Broken bullish trendline may signal weakening uptrend
- Broken bearish trendline may signal weakening downtrend
- Watch for retest of the broken trendline before entering
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Trendlines
- Show Trendlines: Toggle visibility on/off
- Bullish Color: Customize bullish trendline color (default: green)
- Bearish Color: Customize bearish trendline color (default: red)
🧪 Lengths
- Show L1 / Length 1: Toggle and set short-term pivot length
- Show L2 / Length 2: Toggle and set longer-term pivot length
🎯 Detection
- Anchor Replacement: Refines trendline start points for cleaner lines
- Future Extension Bars: Length of the projected (dotted) extension
- Break Bars Limit: How long broken trendlines remain on the chart
📐 Angle Filter
- Use Angle Filter: Toggle filtering of flat/steep trendlines
- Min Angle / Max Angle: Allowed angle range for valid trendlines
🐞 Debug
- Show Angle Label: Display the angle (°) at each trendline's start point,
useful when adjusting the angle filter range
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alerts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🟢 Bullish Trendline Break: Triggers when price closes below a bullish trendline
🔴 Bearish Trendline Break: Triggers when price closes above a bearish trendline
⚡ Any Trendline Break: Triggers on any trendline break event
Setup: ALT + A → Select 【Auto Trendlines】→ Create alert
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Disclaimer
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is an analysis tool, not a trade signal service.
Based on historical pivot data — does not guarantee future price reactions.
Strong trends or sudden volatility may invalidate trendlines.
All trading decisions and associated risks are solely your responsibility.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
KTY | Kim Thank You 🙏
Professional trading indicators built from years of experience.
📱 Telegram
t.me/kimthankyou
🌐 Website
kimthankyou.com
Professional trading indicators built from years of experience.
📱 Telegram
t.me/kimthankyou
🌐 Website
kimthankyou.com
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
KTY | Kim Thank You 🙏
Professional trading indicators built from years of experience.
📱 Telegram
t.me/kimthankyou
🌐 Website
kimthankyou.com
Professional trading indicators built from years of experience.
📱 Telegram
t.me/kimthankyou
🌐 Website
kimthankyou.com
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。