TradingView chart patterns

Gartley pattern: ratios, tolerance and D-point confirmation

A Gartley pattern is a five-point XABCD structure used to study a possible reversal near D. In Scott Carney's definition, B retraces 61.8% of XA and D approaches the 78.6% retracement, with an AB=CD completion and a BC projection nearby. A matching drawing is only a candidate: the selected definition, permitted ratio error and time at which D becomes known determine what a detector can actually report.

See the decision guide

Read the XABCD ratios with the right denominators

For a bullish candidate, X is a low, A a high, B a lower retracement, C a rebound below A and D a decline below B but above X. Reverse the directions for the bearish case. Define each leg length as the absolute difference between its endpoint prices; reject a zero-length denominator.

  • The D retracement starts at A: for a bullish XA from 100 to 200, the 0.786 level is 200 - 0.786 × 100 = 121.4. Measuring 78.6% upward from X would produce a different price.
  • Ratios constrain the same five prices, so they are not independent settings. Exact equality at every nominal ratio may be impossible; a detector needs an explicit confluence and tolerance policy.
  • The harmonic-pattern overview compares multiple families. AB=CD examines the four-point leg relationship. This page adds the X anchor, Gartley-specific ratio conventions and confirmation timing.
MeasurementCalculationCarney reference
B retracement|A - B| / |A - X|0.618
C retracement|C - B| / |A - B|0.382 to 0.886 in Volume One
D retracement|A - D| / |A - X|0.786
BC projection|C - D| / |C - B|1.27 or 1.618
Leg equality|C - D| / |A - B|1.0 for equivalent AB=CD

Published definitions are not interchangeable

TradingView documents XABCD as a manual drawing tool. Its bullish Gartley example uses BC/AB from 0.618 to 0.786 and CD/BC from 1.27 to 1.618. Carney's Gartley page instead names 1.27 or 1.618 BC projections with AB=CD convergence at the 0.786 XA area; Volume One gives a wider C range. A continuous interval accepts values that an endpoint test rejects.

  • Record the source and edition in a detector specification. Do not silently combine the widest allowance from every reference and call the result the official Gartley definition.
  • A ratio label on a manually placed drawing does not establish that its points were objectively selected or that a reversal was confirmed.
  • The hypothetical G-1 specification below uses the TradingView example ranges plus explicit D and leg-equality checks. It is a custom teaching model, not a reproduction of a TradingView detector or a strict Carney implementation.

Calculate one candidate and expose the disagreement

Take hypothetical bullish points X = 100, A = 200, B = 138.2, C = 183.2 and D = 121.4, in that time order. Their lengths are XA = 100, AB = 61.8, BC = 45 and CD = 61.8. The table evaluates unrounded values; displayed decimals are rounded for reading.

  • The candidate passes these five G-1 tests. This is an arithmetic result, not a historical trade or evidence of profitability.
  • If the BC projection instead must lie within 0.03 of either 1.27 or 1.618, it fails: 1.373333 is about 0.103333 from the nearer endpoint. A broad interval and two narrow bands do not identify the same patterns.
  • Keep the price ordering check separate from the ratios. Absolute distances can pass numeric tests even when the points do not alternate in the intended direction.
TestCalculated valueIllustrative G-1 allowance
AB / XA0.6180.608 to 0.628, inclusive
BC / AB0.7281550.618 to 0.786, inclusive
AD / XA0.7860.776 to 0.796, inclusive
CD / BC1.3733331.27 to 1.618, inclusive
CD / AB1.0000.97 to 1.03, inclusive

Make tolerance measurable and retain rejected matches

For G-1, the B and D allowances are absolute ratio errors of 0.010. This means one percentage point of XA, not a 1% relative error in the target ratio. With XA = 100, each allows one price unit around its target. Choose the policy before evaluating outcomes and retain it across the sample.

  • Use one price source consistently, such as candle highs for high pivots and lows for low pivots. Switching between closes and wicks to rescue a match changes the input data.
  • Define pivot strength, minimum spacing, maximum pattern duration and overlapping-candidate handling alongside the ratio checks. These choices can alter the sample even with identical Fibonacci thresholds.
  • A D point beyond X fails the bullish price ordering used here. Reject the Gartley candidate rather than relabeling it automatically as another harmonic pattern without checking that pattern's rules.
Hypothetical alterationResultReason
Change B from 138.2 to 136.0RejectAB / XA becomes 0.640, outside 0.608 to 0.628
Change D from 121.4 to 119.0RejectAD / XA becomes 0.810, outside 0.776 to 0.796
Keep ratios but select a later C after seeing a reboundReject the evaluation methodThe point-selection rule changed after the outcome
Expand tolerance until a losing example disappearsInvalid comparisonThe revised detector must be evaluated as a separate version

D has a price timestamp and a confirmation timestamp

For a timing illustration, call a low pivot confirmed only when three completed bars on each side have strictly higher lows; reject ties. Apply the mirrored rule to highs. Assume X, A, B and C are already confirmed, and all selected points meet the chosen spacing rules. A D low at bar 50 cannot pass this test until bar 53 closes.

  • A label drawn back at bar 50 must still disclose that the detector learned about D at bar 53. An alert or simulated entry cannot be backdated to the earlier low.
  • An optional, separate entry filter might require a completed close above the high of the D candle, on or after pivot confirmation. Freeze that high when D qualifies; a matching Gartley alone does not satisfy this extra condition.
  • In a test using that extra filter, specify an expiry window and invalidation precedence. For example, invalidate first if a completed bar has a low below the saved D, then evaluate the entry condition. This is a chosen rule, not a universal Gartley stop.
  • Confirmation can arrive after part of a rebound has already occurred. Waiting for closed bars limits intrabar changes but does not justify an unconditional non-repainting claim; feed revisions and other script behavior still matter.
EventInformation available thenPermitted label
Bar 50 trades at 121.4Future bars 51 to 53 are unknownProvisional D only
Bar 52 closesOnly two right-side bars have completedStill provisional
Bar 53 closes with all three lows above 121.4D is a confirmed pivot; evaluate the saved ratiosG-1 candidate confirmed at bar 53
Alternative: bar 52 makes a 120.8 lowThe bar-50 pivot test failsDiscard that D; any later candidate starts a new evaluation

Draw it in TradingView, then specify a detector

Use the XABCD drawing tool to place the five selected pivots in time order. Its Coordinates controls accept price and bar values, so the hypothetical example can be reconstructed without measuring screen angles. Check the ratio denominators against the convention you selected.

  • For a Pineify coding request, name the Pine Script version and the detector version separately. For example, request Pine Script v6 implementing your written G-1 rules, with the complete pivot, tolerance and candidate-selection policy attached.
  • Ask for measured ratios, rejection reasons, the D pivot bar and the D confirmation bar as inspectable outputs. Treat those as implementation requirements to review, not as existing outputs of this educational page.
  • Request syntax validation, inspect the generated logic and replay the same sample bar by bar. A compiling detector can still use the wrong denominator or label an event too early.
  • Before adding a strategy, define order timing, stops, position sizing, costs and exits. This page provides no tested win rate, best timeframe or expected return.
Where Pineify fits

Pine Script AI Coding Agent

Turn your named Gartley convention and confirmation rules into a Pine Script draft. Specify the language version, inspect the output and request syntax checks before testing it in TradingView. Pineify does not scan live Gartley patterns on this page.

Draft a versioned Gartley detector

Frequently asked questions

Educational information, not investment advice. All prices, G-1 thresholds and event paths are hypothetical. No historical performance or live scanning is presented. Pattern completion and pivot confirmation do 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.