OPEN-SOURCE SCRIPT

Flexible Reversal Detector

112
Flexible Reversal Detector
An advanced, fully customizable analytical tool designed to identify local trend reversal zones based on candlestick formations. Users have full control over all logic parameters, making it adaptable to different trading styles and preferences.

Key Features
Adjustable maximum pattern length (number of candles)

Customizable body size ratios for initial, middle, and final candles

Configurable minimum price movement (in %) required before a pattern is considered valid

Colored horizontal lines showing the full length of the pattern – helpful in identifying structure, potential support/resistance zones

Optional volume filter – the volume of the final candle is compared to a volume SMA; multiplier can be adjusted (e.g. 1 = equal to average, 0.8 = 80% of average)

Logic Overview
U Pattern
Each bearish candle is treated as a potential start of a reversal pattern.
Subsequent candles, if small enough and within defined thresholds, form the middle part of the structure.
When a bullish candle with a sufficiently large body appears, it is marked as the final candle of the pattern.
The pattern is considered valid if it was preceded by a defined percentage price drop and – optionally – if the volume condition was met.

∩ Pattern
Each bullish candle may act as the initial candle of a potential reversal pattern in the opposite direction.
Following smaller candles form the middle part, as long as they meet the defined criteria.
The appearance of a strong bearish candle marks the end of the formation.
If this pattern is preceded by a certain price increase (and optionally meets the volume filter), it is highlighted on the chart.

Note: On markets with low volatility or on lower timeframes, it is recommended to reduce the percentage thresholds for signal detection. For more dynamic price action or higher timeframes, consider increasing them accordingly.

Visualization
The final candle of the pattern is marked visually on the chart (depending on direction)

Colored horizontal lines indicate the full span of the pattern – from initial to final candle

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。