OPEN-SOURCE SCRIPT

Three-Bar Reversal/Continuation

223
This indicator identifies a three-bar expansion pattern based on range and volume, designed to highlight moments when the market pushes strongly, pauses, and then resumes with confirmation.

Detection Logic

* Bar [2] (two bars ago) must show sufficient strength, determined by the number of conditions met.
* Bar [1] (one bar ago) must be neutral (strength[1] = 0), marking a brief pause.
*Bar [0] (current bar) must continue the expansion, with range and volume greater than the prior bar.
(Bar [3] is used as a safeguard to prevent repeated detection during ongoing strong moves)

Strength Scoring

Each bar is scored 0–3 based on which of the following conditions it satisfies:
* Range exceeds a multiple of the recent average
* Volume exceeds a multiple of the recent average
* Range × volume exceeds a multiple of the recent average

The detection level input controls how many of these conditions must hold to classify a bar as “strong.” This allows tuning from permissive (1 condition) to strict (all 3 conditions).

Parameters & Utility

* length: Lookback period for moving averages of span, volume, and span×volume. Larger values smooth the averages, reducing false positives; smaller values increase sensitivity.
* coeff: Multiplicative threshold to define an unusually strong bar. Higher values reduce frequency but increase reliability.
* detectLevel: Minimum number of conditions that must be met for a bar to count as “strong.”
* showCont: Whether to allow continuation signals away from local extrema (if false, only reversals near highs/lows are considered).
* symbolUp / symbolDown: Customizable plotting symbols for bullish/bearish signals.
* showStrength: Plots tiny dots indicating the strength of each bar (1–3).

Rationale

This structure captures a recurring market motif: strong push → brief pause → renewed push, where the renewed activity is confirmed by both price expansion and volume. Using a combination of statistical thresholds (range, volume, range×volume) and price structure ensures that signals are both measurable and visually interpretable.

Usage Notes

* This setup allows traders to visually or systematically identify potential reversal or continuation points while controlling sensitivity to noise.
* Designed as a mechanical filter rather than a fully automated trading system. Signals highlight notable activity but do not dictate entry, exit, or risk management.
* Works best when combined with trend/context filters or higher-timeframe analysis.
* Adjust the parameters based on the volatility of the instrument and timeframe.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.