Define the three tests before drawing the pattern
Label the lows L1, L2 and L3 in time order, with H1 between L1 and L2 and H2 between L2 and L3. A custom detector needs rules for selecting those swings. The following specification is illustrative; its thresholds are not TradingView defaults or measured optimal settings.
- A fixed 0.5-unit tolerance changes meaning across instruments. A percentage or volatility-scaled tolerance is a different model and needs its own denominator and tests.
- For a repeatable first version, evaluate the latest three qualifying lows. Do not skip a failed middle low simply because an older combination looks better.
- A 5% decline filter does not prove an established downtrend. It makes this example context rule measurable; another definition changes which candidates qualify.
| Rule | Illustrative specification | Reason to reject |
|---|
| Prior decline | L1 is at least 5% below the highest high of the preceding 20 bars | The example reversal-context filter is not met |
| Distinct pivots | Require three bars on either side with strictly higher lows; reject equal-low ties | An apparent low has not yet received three confirming bars |
| Price tolerance | Highest selected low minus lowest selected low is at most 0.5 price units | One low falls outside the permitted band |
| Spacing | Each low-to-low interval is 8 to 30 bars | Adjacent lows describe one cluster, or the interval is too long |
| Rebound and neckline | Use the highest high strictly between each pair of lows; each rebound is at least 3 units above both adjacent lows. Save the higher high as N | The intervening move is too small to pass this rule |
Work through one candidate without moving its neckline
Assume these hypothetical prices pass the prior-decline filter and the pivot checks above. Lows occur at bar 10 = 100.0, bar 22 = 100.3 and bar 34 = 99.9. The intervening highs are 106.0 at bar 16 and 105.0 at bar 28. The low spread is 0.4, both intervals are 12 bars, and the saved neckline N is 106.0.
- The breakout condition is previous close at or below N and current completed close above N. Allow the confirmation bar itself if that condition passes.
- If the crossing happened before L3 became available, do not assign a signal to that earlier bar. This example requires a fresh crossing after eligibility.
- After creating the candidate, retain its prices and bars. A later high cannot quietly change N from 106 to a more convenient level.
| Observation | Decision under this example | Recorded state |
|---|
| Bar 34 prints 99.9 | Wait for the three right-side bars | Third low is provisional |
| Bar 37 closes; all three later lows exceed 99.9 | L3 is now available to the detector | Candidate eligible at 37 |
| Bar 38 trades at 106.4 but closes at 105.8 | The close does not exceed N | No breakout |
| Bar 39 closes at 106.2 after the previous close was 105.8 | Fresh closing crossing above N | Confirmed event at 39 |
| No eligible crossing during bars 37 through 56 | Expire after the 20-bar window | Discard the candidate |
A failed third test can invalidate the shape
Change only the third low in the hypothetical example from 99.9 to 98.8. The spread is now 100.3 minus 98.8, or 1.5 units. That exceeds the 0.5-unit tolerance, so the detector rejects the three-low candidate even if price subsequently rebounds. A later rally does not retroactively make the rejected structure valid.
- TradingView documents a Failed status when price goes below the last bottom before reaching its target. The custom close-based failure rule above is a separate choice.
- A wick through support followed by recovery can fit another hypothesis. Calling it a sweep does not exempt it from a detector rule that rejects a low below support.
- Any trading version also needs order timing, exits, position sizing and costs. A pattern event alone is not a complete strategy.
| Failure type | Example rule or observation | Keep in the record |
|---|
| Third test outside tolerance | L3 = 98.8 fails the permitted low spread | Rejected geometry; no confirmed-pattern signal |
| Support breaks before confirmation | For an accepted candidate, a completed bar low falls below the lowest saved bottom before an eligible breakout | Invalidated candidate; evaluate this before breakout on the same bar |
| Breakout later fails | Under a custom close-based rule, a later close falls below the saved L3 | Keep the original breakout plus its later failure event |
| No breakout by expiry | The 20-bar candidate window ends | Expired setup, distinct from a support break |
Compare a triple bottom with a double bottom and a range
The number of tests describes the geometry; it does not establish a ranking of signal quality. A range can contain three support touches without producing an upward breakout. Use the same swing and tolerance definitions when comparing candidates.
| Structure | What is present | What remains unresolved |
|---|
| Double bottom | Two low tests with one rebound between them | A third test is not needed to evaluate its own breakout rule |
| Triple-bottom candidate | Three qualifying lows and two rebounds | The closing breakout may never arrive |
| Confirmed triple bottom | The saved structure passes its eligible neckline crossing | The signal can still fail or produce a loss after costs |
| Trading range | Price remains bounded by support and resistance | Neither an upside reversal nor a breakout direction is established |
| Inverse head and shoulders | The middle trough is distinctly deeper than the shoulders | Its shoulder and neckline rules need separate definitions |
Record detection time separately from the low
TradingView documents 5/5 pivots in its built-in triple-bottom indicator; In Progress mode can show an unconfirmed third bottom. Its repainting documentation also explains why a pivot drawn on an old candle can become visible only after later candles confirm it. A historical drawing therefore does not prove that an alert was available at that low.
- In the custom three-right-bar example, the low at 34 becomes usable at the close of 37. Store both timestamps, then store the breakout at 39 separately.
- Review the same symbol, timeframe and rules one completed bar at a time. Preserve rejected candidates and failed signals instead of displaying only surviving patterns.
- Before using generated code, inspect the pivot selection, tie handling, invalidation order and event timestamps. Syntax success cannot verify those choices.
- Keep unconfirmed previews visually distinct from confirmed events. Waiting for a chart close addresses intrabar changes, but does not remove every source of repainting.