HOW IT WORKS
Swing Point Detection
The indicator uses a classic pivot-point algorithm with a configurable lookback window. For each bar, it checks whether the high (or low) is the highest (or lowest) value within N bars on both sides. When confirmed:
- A colored dot is placed above the swing high (default: lime green) or below the swing low (default: red).
- The pivot is recorded internally along with its RSI value for divergence analysis.
The lookback parameter controls sensitivity: a smaller value (e.g., 3β5) detects minor swings for scalping, while a larger value (e.g., 10β20) captures only significant structural pivots for swing trading.
RSI Divergence Detection
Each time a new swing point is confirmed, the indicator compares it to the previous swing of the same type:
- Bearish Divergence β Price prints a higher high, but the RSI at that swing high is lower than the previous one. This signals weakening bullish momentum and a potential reversal to the downside. A red down-triangle is drawn above the swing high.
- Bullish Divergence β Price prints a lower low, but the RSI at that swing low is higher than the previous one. This signals weakening bearish momentum and a potential reversal to the upside. A green up-triangle is drawn below the swing low.
For accuracy, the RSI reading is not taken from a single bar. Instead, the indicator scans a small window around each pivot point and uses the maximum RSI for swing highs and the minimum RSI for swing lows β capturing the true momentum peak or trough near the structural turning point.
---
WHAT YOU SEE ON THE CHART
- Dots β Colored circles marking every confirmed swing high and swing low. These give you a clear structural map of the market.
- Triangles β Directional arrows appearing only when a divergence is detected. A down-triangle above a swing high warns of bearish divergence; an up-triangle below a swing low signals bullish divergence.
- No clutter β No lines, no boxes, no separate panels. Just the essential pivot and divergence information, directly on price.
---
HOW TO USE
Spotting Reversals Early
When a triangle appears, it means price structure and RSI momentum are diverging β one of the most reliable early reversal signals in technical analysis. Use these as alerts to look for confirmation entries (e.g., a bearish engulfing candle after a bearish divergence triangle).
Mapping Market Structure
The dots alone provide a clean visual map of swing highs and lows. This helps you quickly identify the current trend: a series of higher highs and higher lows (uptrend) or lower highs and lower lows (downtrend).
**Combining with
Other Tools**
This indicator pairs well with support/resistance zones, order blocks, or supply/demand areas. Use the divergence triangles as a timing filter β enter trades at key levels only when divergence confirms weakening momentum in the opposing direction.
Tuning for Your Style
- Scalpers: set Pivot Lookback to 2β4 for frequent, minor swing detection.
- Day traders: use 5β8 for a balanced view.
- Swing traders: set 10β20 to capture only the most significant structural pivots.
---
KEY ADVANTAGES
- All-on-chart β No need to open a separate RSI panel or cross-reference windows. Divergences are displayed exactly where they matter: at the price level.
- Smart RSI sampling β Uses a windowed max/min approach around each pivot rather than a single-bar reading, reducing false divergence signals.
- Lightweight β The Max History Bars parameter ensures the indicator stays fast even on charts with thousands of bars.
- Fully customizable β Colors, offsets, RSI period, source, and sensitivity are all adjustable to match your preferences and trading style.
---
### DISCLAIMER
This indicator is a technical analysis tool designed to identify swing points and RSI divergences. It does not generate automatic buy/sell signals and should not be used as the sole basis for trading decisions. Divergences can persist or fail in strong trending markets. Always use proper risk management and combine with your own analysis. Past performance does not guarantee future results. Trading involves significant risk of loss.

![Logo "Trend Angle Indicator [Iridio Capital]"](https://market-prod-23f4d22-e289.s3.amazonaws.com/10679735-dd41-4a43-9a66-ece9bcbdf9b4_trend angle-logo.png)





.png)
.png)



