TradeAxis Trendlines

TradeAxis Trendlines is an overlay indicator that automatically builds and maintains diagonal support/resistance trendlines from confirmed swing pivots, ranks candidates to reduce clutter, and provides optional breakout-based risk framing (TP/SL boxes) using structural stops.
This script is built as a single workflow:
- Identify structurally valid trendlines
- Reduce clutter by ranking/filters
- Monitor/visualize breakouts with clear risk framing (disabled in Analysis Mode and on non-standard chart types)
How the trendlines are detected and filtered
1) Confirmed pivot engine (non-instant pivots)
Trendline anchors come from confirmed pivot highs/lows using user-defined Left/Right pivot strength. Because pivots require Right bars to confirm, lines are not drawn at the turning candle and will appear only after confirmation.
2) Candidate generation + structural validation
The script tests pivot-to-pivot vectors and rejects candidates that fail structural criteria, including:
- Minimum line length (bars between anchors)
- Slope filtering with two modes:
Absolute slope bounds (price-per-bar)
ATR-relative slope bounds (thresholds scaled by ATR) - Body-intersection rejection: candidates are filtered out if candle bodies repeatedly cut through the line beyond a tolerance
- Opposite-side invalidation gate: candidates can be rejected/disabled when price closes (or evaluates by Mid-body/Body mode) beyond the “wrong side” of the line, to avoid keeping lines that are already invalidated by structure
3) Touch counting + scoring (clutter control)
Valid candidates are ranked using a weighted score that prioritizes:
- Number of valid touches
- Recency of the last touch
- Line span
By default, the script plots both the primary and secondary (“2nd best”) support and resistance lines; you can disable the secondary set if you prefer a cleaner chart.
4) Dynamic cleanup behavior
Trendlines are continuously refreshed as new pivots confirm. Lines that are decisively broken and then reclaimed can be removed to prevent stale structure from lingering on the chart.
Optional modules
A) Safety lines (structural stop references)
When enabled, the script calculates additional diagonal “safety” lines from a separate pivot stream and selects the best safety reference near the active structure. These safety lines are used as structural candidates for Stop Loss placement in the breakout framing module.
B) Higher-timeframe (HTF) overlays
When enabled, the script runs its trendline detection logic on a user-selected higher timeframe using `request.security()` with lookahead disabled, and overlays the HTF support/resistance onto the current chart. HTF lines are plotted using time-based coordinates and can update as HTF bars confirm.
C) Breakout + Risk/Reward visualization (optional)
When enabled (and on standard charts), the script can flag breakouts and draw a risk/reward box:
- Breakout trigger: candle-body confirmation through the trendline plus a user-selected ATR-based buffer.
Buffer Mode can be set to ATR (buffer = ATR × multiplier) or None (no buffer). - Optional filters:
- Wick filter (rejects candles with excessive upper/lower wick percentage)
- Time windows (inputs are labeled in UTC+4) with optional overnight restrictions and specific block windows
- Minimum breakout body size (ticks)
- Wick filter (rejects candles with excessive upper/lower wick percentage)
Stop Loss / Take Profit framing
- Stop selection is structural-first. The script prioritizes the active safety line (when available), otherwise it falls back to recent swing structure (recent swing high/low candidates) and the best available structural reference.
- Entries can be skipped if risk constraints are violated, including:
Min SL Size (ticks)
Max Allowed SL (×ATR) - Take Profit is projected from the actual stop distance using the selected Risk/Reward Target.
Important notes about the position tools
- This is a visualization/alerting aid. It does not place trades.
- TP/SL hit detection is bar-based (OHLC). If both TP and SL are within the same candle range, the script cannot know which occurred first.
- On non-standard chart types, position tools and entry/exit alerts are disabled.
D) Analysis Mode
When Analysis Mode is enabled, the script disables the breakout/risk framing logic and focuses on technical trendlines (plus structural alerts).
Alerts
Alert conditions are available for:
- Touch Support/Resistance (Primary, Secondary, or HTF)
- New Support/Resistance line detected
- Long/Short position tool placed (when enabled on standard charts)
- A combined “Any Event” condition
Limitations / Notes
- Pivot-based structure is confirmation-based and therefore delayed by the Right-bar setting.
- Trendlines can change as new pivots confirm and ranking updates.
- HTF overlays can visually “step” as higher-timeframe bars finalize and are mapped onto the lower timeframe.
- For best results, load sufficient historical bars (zoom out) so pivot arrays and HTF structure have enough context.
Disclaimer
This tool is provided for technical analysis and educational purposes only. It does not provide financial advice, and past market behavior does not guarantee future results.
Скрипт с ограниченным доступом
Доступ к этому скрипту имеют только пользователи, одобренные автором. Вам необходимо запросить и получить разрешение на его использование. Обычно оно предоставляется после оплаты. Для получения подробной информации следуйте инструкциям автора ниже или свяжитесь напрямую с tradeaxis_systems.
TradingView НЕ рекомендует оплачивать или использовать скрипт, если вы полностью не доверяете его автору и не понимаете, как он работает. Вы также можете найти бесплатные, открытые альтернативы в наших скриптах сообщества.
Инструкции от автора
Отказ от ответственности
Скрипт с ограниченным доступом
Доступ к этому скрипту имеют только пользователи, одобренные автором. Вам необходимо запросить и получить разрешение на его использование. Обычно оно предоставляется после оплаты. Для получения подробной информации следуйте инструкциям автора ниже или свяжитесь напрямую с tradeaxis_systems.
TradingView НЕ рекомендует оплачивать или использовать скрипт, если вы полностью не доверяете его автору и не понимаете, как он работает. Вы также можете найти бесплатные, открытые альтернативы в наших скриптах сообщества.