Trendline Detector

Extended Strategies Beginner Canada TSX Equities TSX Venture Equities ETFs Futures Forex Indices

Identify and trade trend-following diagonal price levels

Learn this and Canada-market strategies in depth — one-time purchase, lifetime access.
Unlock full hub →

Quick Reference

Strategy Type Dynamic Diagonal Support/Resistance Identification Framework
Market Outlook Identify and trade trend-following diagonal price levels
Risk Profile Clear trend-based entries with defined invalidation
Reward Profile Ride trends with trendline bounces; trade breakouts/breakdowns
Time Horizon All timeframes (scalping to position trading)
Iv Environment Trendline breaks often precede volatility expansion
Breakeven Depends on strategy (bounce vs breakout)

Payoff Profile

The Trendline Detector identifies diagonal support and resistance lines connecting swing points. Trendlines define the trajectory of price movement and provide dynamic levels for trade entries, exits, and trend change signals.

Canada Market Details

Market Application All liquid TSX equities • Volatile; trendlines may be less reliable • XIU, XFN, XEG - clean trends on sector rotation • S&P/TSX Composite major trendlines
Canadian Market Characteristics TSX shows seasonal patterns that create trendable moves
Trading Hours 9:30 AM - 4:00 PM ET • Intraday trendlines work best in active sessions
Data Sources TradingView, Bloomberg, broker platforms • TMX for backtesting trend strategies

Frequently Asked Questions

Should I use candle bodies or wicks for trendlines?

Both approaches work. Wicks capture full price rejection (where buyers/sellers actually stepped in). Bodies focus on where price 'agreed' to close. Many traders use wicks for more accuracy. Most important: be consistent in your approach.

How do I know if a trendline is still valid?

A trendline is valid until broken. Signs of validity: price continues to respect the line (bounces), no close beyond the line. Signs of invalidity: price closes beyond line with volume. A trendline that's been broken is no longer valid for bounce trades.

What angle should my trendlines be?

Sustainable trends typically have 20-45 degree angles. Too flat (<10°) may be horizontal S/R instead. Too steep (>60°) is unsustainable and will break. Moderate angles indicate healthy, tradeable trends.

Can I have multiple trendlines on the same chart?

Yes, and you often should. You might have a long-term trendline (months), medium-term (weeks), and short-term (days). Multiple trendlines show the trend at different scales. Higher TF lines are more significant.

What's the difference between a trendline and a moving average?

Trendlines are manually drawn through swing points at fixed angles. Moving averages are calculated averages that automatically adjust. Both can act as dynamic S/R, but trendlines show the 'natural' trend angle while MAs show average price.

How do I trade a trendline break?

1) Wait for close beyond line (not just wick), 2) Confirm with above-average volume, 3) Enter on close or wait for retest of broken line, 4) Stop on other side of broken line, 5) Target based on measured move or prior structure.

What is the retest strategy after a break?

After a trendline breaks, price often comes back to test the broken line. Broken support becomes resistance (short the retest); broken resistance becomes support (buy the retest). This gives better entry and confirms the break was real.

How do I avoid false trendline breaks?

1) Require candle close beyond line (not just wick), 2) Look for above-average volume, 3) Wait for follow-through (next bar continues direction), 4) Consider waiting for retest. No method is perfect, but these filters help.

How do I draw trendlines on volatile stocks?

Use wider tolerance for touches (1-2% vs 0.5%). Focus on obvious swing points. Accept that lines may not be as clean. Consider using closing prices only for cleaner lines. Higher timeframes help filter noise.

When should I adjust or redraw a trendline?

Redraw when: new swing point provides cleaner line, current line is clearly being violated. Don't redraw just to avoid admitting a break. If you're constantly redrawing, the trendline probably isn't valid.

How do I implement automated trendline detection?

Algorithm: 1) Detect swing points (fractal method - high/low higher/lower than N bars each side), 2) Generate all line candidates between same-type points, 3) Count touches within tolerance, 4) Filter by angle, touches, duration, 5) Score and output top lines.

How do I score and rank trendlines?

Scoring factors: Touches (more=better), Duration (longer=better), Timeframe (higher=better), Recency (recent touches=better), Clean touches (minimal penetration). Formula: Score = Touches × TF_multiplier × Recency_bonus. Rank by score.

What is the convex hull approach to trendlines?

Convex hull = outer boundary containing all points. For swing lows, compute convex hull; the lower boundary segments form trendlines. Advantage: objective, no parameter tuning. Disadvantage: may miss internal trendlines.

How do I use ML to predict trendline breaks?

Features: slope, touch count, duration, angle, volume at touches, bounce magnitude trend, higher TF trend. Target: break within N bars (binary). Train classifier on historical trendlines. Output probability of break. Focus on high-hold-probability lines.

How do I build a real-time trendline alert system?

Architecture: 1) Stream price data, 2) On new bar: update swing detection, check trendline touches/breaks, 3) State machine for each trendline (forming→confirmed→active→tested→broken), 4) Fire alerts on state changes, 5) Push to dashboard/mobile.

Master Canada trading strategies on AlgoKing

Full guided lessons, quizzes, and a complete strategy library for the Canada market. One-time purchase. No subscription, ever.

Get Canada access →