Reversal Sniper
Identifies high-probability reversal bars by analyzing the shape of each candle — specifically the ratio of tails to body, close position within the range, and whether the bar actually breaks away from the prior two bars. The goal is to catch genuine turning points, not noise.
A purple triangle above a bar marks a sell signal: a bearish bar with a meaningful top tail, a small bottom tail, and a close near the low that undercuts the prior two lows. A yellow triangle below a bar marks a buy signal: the mirror image. When a strong follow-through bar fires within the lookback window, a ✓ checkmark confirms the move and the background lights up.
Strictness input: Relaxed fires more signals; Strict filters to only the cleanest setups. Start with Medium and adjust based on your timeframe.
Signal Guide
| Signal | Shape / Color | What It Means |
|---|---|---|
| Purple Triangle | Triangle down above bar + purple bar color | Sell signal — bearish reversal bar with top tail, strong body, close near low, undercuts prior 2 lows |
| Yellow Triangle | Triangle up below bar + yellow bar color | Buy signal — bullish reversal bar with bottom tail, strong body, close near high, clears prior 2 highs |
| Purple ✓ (faded) | Checkmark above bar + faded purple bar + purple background | Sell confirmation — strong bearish follow-through bar within lookback window after a sell signal |
| Yellow ✓ (faded) | Checkmark below bar + faded yellow bar + yellow background | Buy confirmation — strong bullish follow-through bar within lookback window after a buy signal |
Input Parameters
| Input | Default | Purpose |
|---|---|---|
| Min Top/Bottom Tail Ratio | 0.33 | Minimum fraction of bar range the reversal tail must occupy |
| Max Top/Bottom Tail Ratio | 0.50 | Maximum tail fraction — keeps out bars with excessively long tails |
| Max Opposing Tail Ratio | 0.15 | The opposite tail must be very small (clean reversal structure) |
| Detection Strictness | Medium | Relaxed (0.8×) / Medium (1.0×) / Strict (1.2×) multiplier on close-move threshold |
| Show Confirmation Bars | On | Toggle checkmark and background highlight for confirmation bars |
| Confirmation Lookback | 3 | Maximum bars after signal bar to look for a valid follow-through bar |
Pine Script Code
//@version=5
indicator("Madstocks-Reversal Sniper", overlay=true)
// ──────────────────────────────────────────
// topTailMin = input.float(0.33, ...)
// sellSignal = isBearish and opensNearPriorClose
// and goodTopTail and strongBearBody
// and reversesPriorBars
// for i = 1 to confirmationLookback
// if sellSignal[i] and isStrongBearishContinuation
// isFinalSellConfirmation := true
// plotshape(sellSignal, color=color.purple, ...)