← All tools Trading Ranges 100% FREE
Generators

Reversal Candle Scan Generator

The candle patterns you fade only matter at the edge, and every built-in candle scanner fires them everywhere. Pick the patterns, set how far back the range looks, how wide the edge zone is and how long a hammer's shadow has to be, and the generator writes a TradingView indicator that marks and alerts those candles only when they print inside the edge zone of the range. The pattern rules are Nison's from Japanese Candlestick Charting Techniques (1991), the same ones the Range Edge Candle Grader uses, and the range is a Donchian lookback so it needs no drawing. Paste the script into the Pine editor, add it to the chart, set the alert.

Min range keeps the scan quiet when the lookback is too tight to be a range at all: the Donchian box has to be at least this many ATR(14) tall.

Patterns to scan
Pine Script v5
···Patterns in the scan

Your scan

Set the numbers and tick the patterns. The script rewrites itself as you go.


        

How it's built. The range is the highest high and lowest low of the last N bars, shifted 1 bar so the signal bar can't be its own edge. The edge zone is the bottom and top X% of that box. A candle counts only if its low is inside the bottom zone (for longs) or its high is inside the top zone (for shorts), and only if the box is at least the minimum number of ATR(14) tall. Pattern rules, for the low: hammer, lower shadow at least R times the body, upper shadow under 15% of the bar's range, body in the top third; bullish engulfing, a down bar followed by an up bar whose body covers the prior body end to end; piercing line, opens at or under the prior close and closes above the prior body's midpoint after a down bar; tweezer bottom, 2 lows within 10% of the ATR of each other, down bar then up bar; inside bar reversal, a bar inside the prior bar's range that closes above the prior bar's midpoint. Shorts are the mirror image. Alerts fire once per bar close. The script uses request.security for nothing and repaints nothing; every value is from closed bars or the current bar's own OHLC. Keyboard: 1 to 5 toggle the patterns.

Educational tool only, not financial advice. A scan finds candles; it doesn't find trades. Run the hit through the Range Edge Candle Grader before you size it.

Jason Parker, founder of Trading Ranges

Built by Jason Parker, founder of Trading Ranges.

Jason Parker, founder of Trading Ranges

Built by Jason Parker, founder of Trading Ranges.