TradingView chart patterns

Inverse head and shoulders pattern: confirm the neckline break

An inverse head and shoulders pattern is a potential bullish reversal structure with three lows: a left shoulder, a lower head and a right shoulder above the head. The two intervening highs define the neckline. A recognizable shape is still a candidate until its breakout rule is met. The built-in TradingView pattern uses a close above the neckline after the right shoulder forms; that confirmation does not guarantee further gains.

See the decision guide

Identify the shoulders, head and neckline

Read the sequence from left to right: shoulder low, reaction high, head low, reaction high, shoulder low. The middle low must be below both shoulders. An inverted head and shoulders pattern describes the same formation; the usual reversal interpretation also requires a preceding decline. Three lows inside an existing uptrend need a different context assessment.

  • Symmetry is a rule to define, not an instruction to search backward for a prettier formation. Specify both price tolerance and allowed spacing.
  • Equal-depth lows are closer to a triple-bottom hypothesis. Two lows alone do not establish this five-point structure.
PointWhat to recordReject or review when
Left shoulderFirst selected low and its barA later review replaces it solely to make the shape fit
First neckline anchorReaction high between left shoulder and headThe high falls outside those two lows
HeadMiddle low, below both shouldersAll three lows are effectively equal
Second neckline anchorReaction high between head and right shoulderAn unrelated later high is used to lower the breakout threshold
Right shoulderFinal selected low and its confirmation barIts price falls below the head

Calculate a sloping neckline at the breakout bar

For a detector using linear prices and bar indices, let the neckline anchors be price P1 at bar b1 and price P2 at bar b2. Its value at bar t is N(t) = P1 + (P2 - P1) × (t - b1) / (b2 - b1). Require b2 > b1. Store these anchors when the candidate becomes eligible; later highs must not silently redraw the threshold for that candidate.

  • A rising neckline increases the required breakout price with time. A falling neckline lowers it. A flat line keeps the same threshold.
  • Use N(t) for the current comparison and N(t - 1) for the previous comparison. Comparing both closes with the current line value changes the crossing test.
  • On a falling neckline, a crossover can occur partly because the threshold falls. If your hypothesis requires upward price movement too, add an explicit close-above-previous-close condition and test it separately.
  • The formula uses arithmetic prices. A line interpolated in logarithmic price space is a different rule; do not mix the two in one test.

A reproducible example with unequal shoulders

These hypothetical prices illustrate a candidate, not an observed trade. Assume a preceding decline has already passed a separately defined trend filter. Select lows at bar 10 = 100, bar 20 = 94 and bar 30 = 101, with intervening highs at bar 15 = 110 and bar 25 = 108. The neckline falls by 0.2 price units per bar. At the head bar its value is 109, so head depth is 15.

  • The tolerance denominator matters. Fifteen percent of head depth is different from fifteen percent of the stock price. Reject a zero or negative head depth before calculating the ratio.
  • A more unequal right shoulder at 103 would fail this particular tolerance: its difference from 100 is 3, greater than 2.25. That is a rule rejection, not proof that price cannot rise.
  • Allow a crossing on the confirmation bar, as in this example. If the crossing happened before that bar, do not backdate a signal; require a later fresh crossing or reject the candidate.
Example ruleCalculation or conditionResult
Shoulder toleranceAbsolute shoulder difference ≤ 15% of head depth1 ≤ 2.25: accepted
SpacingEach shoulder-to-head interval is 5 to 20 barsBoth intervals are 10 bars: accepted
Pivot confirmationThree completed bars on each side of a selected extremeThe right shoulder at 30 is first usable at the close of 33
BreakoutPrevious close ≤ previous neckline; current close > current necklineIf close 32 = 106.5 and close 33 = 106.7, the line values are 106.6 and 106.4: accepted at 33
Candidate expiryNo qualifying breakout in the first 20 bars starting at right-shoulder confirmationDiscard after that window; do not keep lowering an old neckline indefinitely

Distinguish unfinished patterns, retests and failure

Use separate states so a completed shape is not confused with a completed trade. The following lifecycle extends the illustrative rules above. Its close-based failure rule is a custom choice, not a claim to reproduce every TradingView Auto Chart Patterns status.

  • In the numerical example, N(35) is 106. A low of 105.9 and close of 106.3 on bar 35 would pass the stated retest rule. A later close at 100.8 would fail the saved right-shoulder threshold of 101.
  • A close back below the neckline is an earlier warning than the chosen shoulder failure rule. You can test it as a separate exit, but changing between exits after seeing the outcome invalidates the comparison.
  • A retest is not required by the basic pattern definition. Waiting for one changes entry timing and excludes breakouts that never return.
  • A signal condition is not a fill price. Any strategy version must specify order timing, commissions, slippage and stop behavior independently.
State or eventIllustrative decisionWhat it means
UnfinishedRight shoulder is unconfirmed, or no eligible neckline crossing existsMonitor the candidate without a confirmed breakout label
Invalid before breakoutA completed bar has a low below the saved head, or the candidate expiresReject before evaluating a breakout on that bar
Confirmed breakoutThe crossing rule passes after all required pivots are knownRecord one event at the current close
Optional retestWithin the next 10 bars, the low is within 0.2 of N(t) and the close is above N(t)A second condition, evaluated after the breakout bar
Failed after confirmationA later completed close is below the saved right-shoulder lowEnd this example setup; retain its original breakout in the history
No retestThe retest window ends without a qualifying touchSkip a retest-based entry; the earlier breakout still occurred

Check when the signal was actually knowable

The TradingView repainting documentation explains that pivot scripts can place a historical drawing on a bar only after subsequent bars identify the pivot. Keep the geometry attached to its original points, but put the signal marker on the bar where all conditions became available. A confirmed-bar rule also avoids treating a temporary intrabar crossing as a finished close.

  • Write the swing-selection rule before testing: for example, retain the latest five alternating confirmed pivots, resolve consecutive same-side pivots by keeping the more extreme one before candidate creation, and then freeze the candidate.
  • Define equal-price ties and minimum spacing. Two detectors can disagree without either containing a syntax error.
  • Replay the right shoulder one bar at a time. In the example, bars 30, 31 and 32 cannot carry the confirmed breakout event.
  • Record rejected candidates and failed breakouts as well as completed winners. Preserve old signal timestamps when a newer overlapping pattern appears.
  • Compare the same fixed rules on a separate period. This page provides no measured win rate, preferred market or best timeframe.

Read TradingView pattern states before adapting them

The official TradingView Inverse Head And Shoulders documentation describes an In Progress mode that can show emerging patterns before the right shoulder is a confirmed pivot. It also distinguishes New Pattern from Pattern Formed alerts. Its documented Failed status concerns price moving below the right shoulder before the target is reached. These product-specific states are not interchangeable with the custom close-based lifecycle above.

  • For a custom Pineify draft, provide the pivot window, tie rule, shoulder tolerance, fixed neckline anchors, breakout timing, expiry and failure conditions together.
  • Ask for separate timestamps for geometric pivots and confirmed events, then review the generated script and request a syntax check. Compilation alone cannot establish that the detector follows your trading rules.
Where Pineify fits

Pine Script AI Coding Agent

Turn your written pattern rules into a Pine Script draft with Pineify. Specify when pivots become available and where event markers belong, then inspect the result in TradingView. This guide does not scan live markets or supply a tested trading strategy.

Draft a pattern detector

Frequently asked questions

Educational information, not investment advice. All numerical examples and thresholds are hypothetical. Pattern confirmation does not guarantee a reversal or profit; no backtest or live performance is reported here.

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.