TradingView chart patterns

Double top pattern: confirmation beyond two highs

A double top pattern is a potential bearish reversal with two similar highs separated by a pullback. The low between the highs defines the neckline. Two peaks alone are a candidate: TradingView considers its built-in pattern formed when price closes below that neckline after the second peak. Confirmation records a breakdown; it does not establish that the decline will continue.

See the decision guide

Identify the two highs and the intervening low

A double top chart pattern resembles an M after a rise. Follow the time order: first high H1, intervening low N, then second high H2. The neckline is horizontal at N. A small second-peak overshoot can fit a tolerance rule, while two adjacent high candles without a distinct pullback do not satisfy the rule set below.

Part of the structureRule to defineReason
Prior riseA separate trend filter using information available before H1The reversal hypothesis needs a preceding advance, rather than an arbitrary M inside a range.
Peak similarityMaximum absolute difference between H1 and H2, with an explicit denominatorTen percent of pattern height is different from ten percent of the asset price.
Peak spacingMinimum and maximum bars between H1 and H2Bar counts keep the rule consistent; their elapsed time changes with the chart timeframe.
Valley and necklineLowest low strictly between the selected peaks, below both peaksA later low must not move the neckline of an existing candidate.

An illustrative rule set with explicit tolerances

These settings are a worked example, not recommended parameters or a replica of the TradingView detector. Assume a separately specified prior-rise filter has passed. Use standard price candles and local highs with three completed bars on each side; reject tied highs in that seven-bar window. Retain the latest two confirmed highs only when the geometry below passes.

  • Freeze both highs and N when the candidate is created. Evaluate one active candidate at a time, and consume it after one confirmation.
  • Before confirmation, invalidate the candidate if a completed bar has a high above max(H1, H2) + 0.10 × D. In this example that boundary is 100.6; check invalidation before the breakdown rule on the same bar.
  • The valley-depth rule limits shallow pullbacks. It does not prove buying pressure has weakened or that a reversal will follow.
DecisionIllustrative ruleExample calculation
Pattern height DD = max(H1, H2) - N; require D > 0H1 = 100, H2 = 99.6, N = 94: D = 6
Peak toleranceAbsolute difference between peaks ≤ 0.10 × D0.4 ≤ 0.6: accepted
Peak separation10 to 40 bars, inclusiveH1 at bar 10 and H2 at bar 30: 20 bars
Valley depthmin(H1, H2) - N ≥ 0.03 × min(H1, H2)5.6 ≥ 2.988: accepted
ConfirmationAfter H2 is known, previous close ≥ N and current completed close < NClose 33 = 94.3; close 34 = 93.8: event at bar 34
Candidate expiryAllow 20 completed bars starting with H2 confirmation; then discardH2 confirmed at bar 33: eligible bars 33 through 52

Compare an unfinished M, a continued rally and a failed break

All three hypothetical paths start with the same highs at 100 and 99.6 and the same neckline at 94. Read the following as schematic price paths, not market charts or backtest results. Each arrow is a later event; the intervals are not to scale.

  • Path A may later confirm, invalidate or expire. Calling it a failed trade before an entry exists mixes two different outcomes.
  • Path B can develop into a different structure. Do not redraw the old peaks after the rally just to preserve a bearish label.
  • Path C belongs in the breakdown sample even if the detector later removes its drawing. Omitting it biases a historical review.
Hypothetical event paths under the custom rules above. Path C uses the close-above-neckline failure rule described below.text
Shared shape:  rise -> H1 100 -> valley 94 -> H2 99.6
Neckline:       94, frozen for this candidate

A. Unfinished:  H2 -> close 94.4 -> close 95.2
   No completed close below 94; no breakdown signal.

B. Rally:       H2 -> close 98.0 -> high 101.0
   High exceeds 100.6 before confirmation; candidate invalid.

C. Failed:      H2 -> close 94.3 -> close 93.8 -> close 94.5
   Breakdown confirmed, then neckline reclaimed.
   The original breakdown remains in the record.

Put the signal on the bar where it becomes knowable

A peak at bar 30 with three right-side confirmation bars is first known at the close of bar 33. A marker drawn back on bar 30 describes geometry, not an opportunity available then. TradingView documents this distinction for pivot-based scripts; its own Double Top indicator uses 5/5 pivots and can also show emerging structures with In Progress enabled.

  • If price crossed below 94 on bar 31, this example cannot issue a confirmed-pivot signal on bar 31. Its fresh-crossing rule requires a later eligible crossing, including on bar 33 if the conditions hold.
  • A wick below 94 followed by a close above it does not pass the close-based rule. An intrabar alert would describe a different event.
  • Store pivot time, pivot confirmation time and neckline event time independently. Review the second peak bar by bar before trusting a historical marker.
  • Waiting for the chart bar to close addresses intrabar changes. It does not remove every possible source of repainting or make a pattern predictive.

Separate breakdown failure, retest entries and trade exits

For the example, define an early failed-break event as the first later close above the frozen neckline. This is a custom rule. TradingView documents a different Failed status: price moves above the second top before reaching the target. Name the chosen definition in a report so these outcomes are not counted as though they were identical.

  • A double top trading pattern is not a complete strategy until position size, stop orders, costs and maximum holding time are specified. A stop beyond a peak and a close-based exit have different risks.
  • If a stop and target are both touched within one historical candle, their sequence may be ambiguous from OHLC alone. Check the broker-emulator assumptions and available intrabar data.
  • Keep breakdown-entry and retest-entry results separate. Combining their best outcomes after the fact does not test either rule.
ChoiceIllustrative specificationTrade-off
Breakdown entrySubmit a market order after the qualifying closeIn a default TradingView strategy, the earliest historical fill is normally the next bar open; it can differ from the signal close.
Retest entryDuring the next 10 bars, require a high within 0.2 of N and a close below N, provided no failure close occurred firstA high of 94.1 and close of 93.7 qualifies. A decline that never returns produces no retest entry.
Early failureA later close above N ends this example setupA reclaim may be temporary. This rule can exit before a subsequent decline.
Geometric projectionUse N - D as a reference: 94 - 6 = 88This chosen height convention is a price projection, not a probability or guaranteed destination.

Keep a candidate log alongside the trade report

A trade export contains executed trades, so it cannot show every rejected or missed pattern. Keep a separate candidate log with the two peaks, neckline, settings, eligibility time and outcome. Label visually misidentified structures separately from correctly detected breakdowns that later lost money.

  • Record all eligible candidates and classify them as expired, invalid before confirmation, confirmed, or failed after confirmation. Preserve the failed paths rather than only saving target hits.
  • To measure missed patterns, review a fixed sample independently under the same written rules. A log of detected candidates alone cannot establish the miss rate.
  • Give Pineify AI Coding Agent the full specification, including tie handling and event timestamps, when requesting a detector draft. Review the output and its syntax before testing it in TradingView.
  • If you add trade rules, export the resulting trades for Backtest Report analysis. Use the separate candidate log to investigate false detections; the report does not automatically audit chart-pattern recognition.
  • Compare fixed rules on a separate date range and include commissions and slippage. No measured win rate or preferred timeframe is established by this example.
Where Pineify fits

Pine Script AI Coding Agent

Turn your written peak, spacing and neckline rules into a Pine Script draft. Inspect the generated conditions and confirmation timestamps in TradingView. This page explains a detector specification; it does not scan live markets.

Also useful: Backtest Report. Analyze exported strategy trades after adding and testing entry and exit rules. Keep untraded candidates and detection errors in a separate log.

Draft double top rules

Frequently asked questions

Educational information, not investment advice. Prices, thresholds and paths on this page are hypothetical. No backtest or live performance is reported. Pattern confirmation does not guarantee a reversal or profit.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.