What this TradingView script does
Fractals Trend is a trend-following overlay that leverages fractal swing points to define dynamic support and resistance zones. By storing and averaging recent high and low fractals, it determines trend direction and plots a smooth band that flips depending on market bias—displaying support during uptrends and resistance during downtrends.
🔵 CONCEPTS
- Fractal Swings: Fractals are identified using a customizable length. A high fractal forms when the current high is the highest in a range; a low fractal when the current low is the lowest.
- Fractal Memory: The indicator keeps a rolling window of recent high and low fractals inside arrays, limited by the user-defined storage quantity.
switch upperF => FracrtalsUpper.push(high) lowerF => FracrtalsLower.push(low) FracrtalsUpper.size() > fCount => FracrtalsUpper.shift() FracrtalsLower.size() > fCount => FracrtalsLower.shift()
- Trend Detection: Price crossing above the average, min/max or median high fractals signals an uptrend; crossing below average, min/max or median low fractals signals a downtrend.
- Dynamic Band Plotting: Depending on the trend, the script plots the average of either the upper or lower fractals as a trailing support or resistance line.
- Visual Confirmation: Fractal labels appear as triangle markers at highs and lows, providing additional structural context.
🔵 FEATURES
- Automatically detects high and low fractals using customizable length.
How traders can use it
Use Fractals Trend as a chart context layer inside TradingView: read the structure it highlights, compare it with your market bias, and let the script narrow which moves deserve attention.
The strongest workflow is to combine the script with higher timeframe structure, volume context, and a repeatable execution plan instead of treating any single label as a standalone trade.




