PROTECTED SOURCE SCRIPT
Обновлено

Allyhshn - Trend Reversal Indicator

285
Allyhshn – Trend Reversal Indicator

Multi-Timeframe RSI & TSI Climax Detection System

Is an advanced multi-timeframe reversal and climax detection tool designed to identify buying and selling exhaustion zones across multiple intraday and higher timeframes.
The script combines RSI extreme conditions, price-location validation, and TSI (True Strength Index) confirmation to isolate high-probability reversal events, filtering noise and avoiding premature signals.


1) Core Concept

The indicator focuses on identifying trend exhaustion and climax events, rather than continuous signals.
A valid signal requires three layers of confirmation:
a) Momentum extreme (RSI Buying or Selling Climax);
b) Price context (price reaching statistically relevant zones);
c) Trend exhaustion confirmation (TSI and TSI EMA thresholds).

This structure makes the indicator particularly suitable for:
* Mean-reversion setups;
* Scalping reversals;
* End-of-move detection;
* Liquidity exhaustion zones.


2) Multi-Timeframe Architecture

Automatic Timeframe Detection
The script automatically detects the active chart timeframe and maps it to an internal enumeration:

Supported Timeframes:
* 5s, 10s, 15s, 30s
* 1m, 5m, 15m, 30m
* 1h, 3h, 6h

Each timeframe has independent parameters, allowing precise tuning per market microstructure.


3) Timeframe-Specific Configuration

For each supported timeframe, the user can independently configure:
RSI Parameters:
* RSI Length – Sensitivity of momentum detection.
* RSI Buying Climax – Upper RSI threshold indicating buying exhaustion.
* RSI Selling Climax – Lower RSI threshold indicating selling exhaustion.

Lookback Context

* Lookback (N candles) – Defines how far price extremes are evaluated to confirm exhaustion.
* Prevents signals from triggering in irrelevant price areas.

Trend & Signal Parameters:
* Trend Overbought / Oversold – Trend context values.
* Trend Signal – Smoothing parameter for internal calculations.


4) Price Location Validation (Context Filter)

To avoid false signals, RSI extremes are not enough on their own.
The script validates whether price is:

* Near the lowest price region of the lookback (bullish exhaustion);
* Near the highest price region of the lookback (bearish exhaustion).

This ensures that:
* Selling climaxes occur near downside extremes;
* Buying climaxes occur near upside extremes.


5) TSI (True Strength Index) Confirmation

Purpose
TSI is used as a trend exhaustion and momentum decay filter.

A signal is validated only when:
* TSI crosses into a predefined bullish or bearish exhaustion zone;
* TSI EMA confirms the loss of directional momentum.

This avoids:
* Counter-trend signals during strong trends;
* Early reversals without momentum decay.


6) Selling Climax Detection (Bullish Reversal)

A Selling Climax is detected when:
* RSI is at or below the Selling Climax threshold;
* Price reaches a statistically relevant lower zone;
* TSI is below the bullish signal threshold;
* TSI EMA confirms momentum exhaustion.

Visualization

* A green upward label (“Selling Climax”) is plotted below price.
* Only the most extreme event within the lookback window is retained.

This highlights zones where:
* Sellers are exhausted;
* Absorption or capitulation may be occurring;
* A bullish reversal becomes statistically favorable.


7) Buying Climax Detection (Bearish Reversal)

A Buying Climax is detected when:
* RSI is at or above the Buying Climax threshold;
* Price reaches a statistically relevant upper zone;
* TSI is above the bearish signal threshold;
* TSI EMA confirms momentum exhaustion.

Visualization:
* A red downward label (“Buying Climax”) is plotted above price.
* Only the most extreme event within the lookback window is retained.

This highlights zones where:
* Buyers are exhausted;
* Distribution or rejection may be occurring;
* A bearish reversal becomes statistically favorable.


8) Signal De-Duplication & Quality Control

To maintain chart clarity and signal quality:
* Only one active signal per direction is maintained within the lookback window;
* New signals replace old ones only if they occur at more extreme price levels;
* The total number of visible labels is capped via user input.

This prevents:
* Signal clustering;
* Visual noise;
* Over-interpretation of repeated RSI extremes.


9) Visual Placement & Chart Integration

* Labels are positioned using ATR-based vertical padding to avoid overlap with candles.
* Signals are drawn directly on the price chart (`overlay=true`).
* Designed to remain readable on ultra-low timeframes (seconds charts).


10) Display Controls

Global Controls:
* Show Flags – Enable or disable all signals.
* Only in Event – Optional filter to restrict display to true event transitions.
* Display (N) Flags – Limits the number of historical signals shown.


11) Intended Use Cases

This indicator is designed for traders who:
* Trade reversals and mean reversion;
* Operate on scalping and intraday timeframes;
* Look for exhaustion rather than continuation;
* Combine RSI with structural price context.

It works especially well when combined with:
* Order Flow / Volume Delta tools;
* Liquidity and absorption analysis;
* Support & resistance frameworks.


12) Account & Data Compatibility

* Uses only native TradingView indicators (RSI, ATR, EMA, TSI).
* Works on all TradingView accounts.
* No external data or proprietary feeds required.


13) Key Strengths
* True multi-timeframe independence;
* Strong noise filtering;
* Context-aware RSI usage;
* Clear, non-repainting climax signals;
* Professional-grade reversal logic.


14) Account Compatibility
* Does not require proprietary order book or footprint data.
* Works on all TradingView accounts.
* Uses only publicly available TradingView Information.
Информация о релизе
Update for customizing the text and color of the indicator
Информация о релизе
General Updates
Информация о релизе
This update focuses on correctness, stability, and performance while preserving the original idea of the indicator: highlighting potential reversal zones where price reaches an extreme area (range-based zone) with RSI climax conditions, and confirming with TSI momentum.

What’s new in this version

1) TSI is now timeframe-correct

The TSI calculation now uses the active timeframe parameters (long/short/signal lengths) instead of being locked to a single preset timeframe.

This improves consistency across different chart timeframes and makes the momentum filter behave as intended.

2) “Only in event” is now properly implemented

When enabled, labels are triggered only on the signal event (a fresh transition into the full signal), instead of potentially repeating on every bar where the condition remains true.

When disabled, the indicator behaves like the original, showing labels whenever the full signal condition is present.

3) Lookback caps for ultra-fast timeframes (performance improvement)

On very small timeframes, large lookbacks can be expensive because the script repeatedly evaluates lowest() / highest() over big windows.

This version adds optional lookback caps for:

5s / 10s

15s / 30s

The cap reduces CPU load while keeping the same logic and behavior.

4) Minimum bar cooldown between new labels (anti-spam + lighter rendering)

Added an optional “Min bars between signals (cooldown)” setting.

This limits how frequently new labels can be created, which reduces clutter and improves performance during consolidation.

Important: updates to a “more extreme” point (e.g., a lower low for bullish climax, higher high for bearish climax) are still allowed, so the indicator can continue refining the best extreme inside the lookback window.

Notes

This tool does not attempt to predict price. It highlights potential reversal zones based on extreme conditions and momentum confirmation.

Default settings aim to keep the script responsive across multiple timeframes, especially on lower intervals.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.