Write a definition before scanning
A rounded recovery and a smaller pullback describe the visual idea, but do not specify a unique detector. The original-author descriptions linked below use different pivot, curve and retracement rules. This page supplies an independent fixed-span approximation. Its thresholds are research settings, not an official TradingView pattern definition or a validated trading strategy.
- The left-rim close must be at least 10% above its close 20 bars earlier. This endpoint test is a coarse prior-rise filter, not proof of a sustained uptrend.
- All interior cup highs and all handle highs must stay at or below the higher rim. The handle-low rule keeps the pullback within half the cup height, measured down from the right rim.
- The cup span counts intervals, so 60 intervals contain 61 bars including both rims. The low and dwell tests use only the 59 interior bars. With tied lowest lows, the code uses the more recent one.
- Daily bars are trading sessions for session-based instruments, not calendar days. Missing history produces blank outputs, not an accepted candidate.
| Measurement | Definition used here | Default acceptance |
|---|---|---|
| Cup duration | Bar-index distance from left rim to right rim | 60 daily intervals; configurable from 35 to 130 |
| Cup depth | 100 × (left rim − lowest interior low) / left rim | 12% through 33%, inclusive |
| Rim mismatch | 100 × abs(right rim − left rim) / left rim | No more than 3% |
| Bottom location and dwell | Bottom position within cup; closes in lowest 35% of cup height | Bottom in middle 20% to 80%; at least ceil(10% × cup span) low closes |
| Handle duration | Bars after the right rim and before the evaluated bar | 10 daily bars; configurable from 5 to 20 |
| Handle depth and retracement | 100 × (right rim − handle low) / right rim; same fall / cup height | Depth > 0 and ≤ 12%; retracement ≤ 50% |
| Confirmation | Evaluated close > max(left rim, right rim) | Strict closing break; a touch or wick does not count |