Skip to main content
AuctionFoundry
Menu

INDICATOR MANUAL

Harmonic pattern indicatorAuto Harmonic Patterns [AFD] · full manual · published to TradingView

Read twelve harmonic formations, their Potential Reversal Zones and frozen Setup checks, then distinguish formation status from the reference levels price later touched.

Download the AHP user manual (PDF)

60 documented settingsPublished on TradingView · Sep 7, 2026

Start here

What the indicator does, the questions it can help answer, and its fresh-install defaults.

Auto Harmonic Patterns [AFD], shown as AHP [AFD] on the chart, matches confirmed swing-leg ratios to defined harmonic windows. The twelve names are Gartley, Bat, Alt Bat, Butterfly, Crab, Deep Crab, Cypher, Shark, Nen Star, 5-0, ABCD and Three Drives. Bullish describes a W-shaped orientation with D at a low; bearish describes an M-shaped orientation with D at a high. Neither word is an instruction.

A Potential Reversal Zone (PRZ) is the outer range of the pattern’s canonical price projections, not necessarily their overlap. Setup records geometry and optional prior-trend checks at confirmation. Only qualifying Setups carry configured Entry, Target and Stop prices; other displayed formations can retain a PRZ and an explanation of their missing Setup.

The two swing readings use the current chart timeframe. A completed formation is available only after D confirms, then is drawn back to earlier pivots. Optional forming candidates and projected D zones can change or disappear. The historical position of a drawing is not the time it became available.

The script is free and open-source under MPL-2.0. Pattern definitions draw on published harmonic work, including Scott Carney and Darren Oglesbee. Auction Foundry’s implementation combines Setup qualification, shared-D labels and separate formation/level tracking; internal components originate in Classical Auto Chart Patterns and Fibonacci Confluence. No ownership of harmonic methods is claimed.

Fresh-install defaults10 documented defaults

Swipe or scroll horizontally to see every column.

Auto Harmonic Patterns fresh-install defaults
AreaDefaultResult
PresetStandardTriangle fill, Setup markers and the levels table are effectively on; forming patterns and projected D zones are off. Show PRZ and Show levels follow their own switches.
Swing strength / Major swing strength8 / 24Pivots require that many bars on each side. Major adds a larger reading of the same timeframe; below 8 is off, otherwise it must exceed Swing strength.
Ratio tolerance / skipped swing8% / OnTolerance is relative to each ratio-window edge. A leg can skip one interior counter-swing of at most 0.382 of that leg.
Pattern visibilityBoth orientations; ABCD offThe other family switches are on. Family and orientation controls filter drawings; detection and pattern/lifecycle alerts continue.
Triangle transparency60%0 is solid and 100 is invisible. Existing instances retain their saved value. Finished patterns lose their triangle fill.
PRZ / levels / prior trendOn / On / requiredThe Setup trend basis is Swing structure. Show trend context displays the frozen reading independently of the requirement.
Targets / Stop0.382R, 0.618R, 1.0R / structureTargets are sorted. Structure Stop starts at D with a 0.5 ATR buffer; R is C-to-D pattern distance, with its ATR cap off.
History / age / search5 kept / 300 bars / 600 barsPatterns kept selects finished drawings. Bars to apply bounds age after confirmation; the formation’s own span can end it earlier. Pivot chain bars bounds search separately.
Reached-level displayClearReached Targets disappear; T3 or Stop clears the ladder. Aged levels and PRZ are hidden by default, while eligible retained table records remain.
Position size / alert formatOff / BriefAmount per Setup and Account size both default to zero. Projected-D alert is off. A running TradingView alert must be created separately.

How it works

How the indicator turns chart data into the states and drawings you see.

Confirmed pivots and availability

With Swing strength 8, a D pivot on bar 100 can produce a completed formation only when bar 108 closes and the checks qualify it. The drawing then reaches back to D and earlier pivots. Level-touch recording can begin on bar 109. This is an illustrative timing sequence, not a market test. The Major reading has its own delay; a formation found by both readings is admitted once, by the reading that confirms first.

Ratio windows and drawing filters

Every required leg window must hold within Ratio tolerance. Zero tolerance uses the defined textbook figures. The optional skipped swing must remain strictly inside its enclosing leg and be no more than 0.382 of its size. ABCD uses the equal-leg form; a five-point name admitted on the same C-to-D leg on the same bar suppresses standalone ABCD admission. Family switches, Orientation and Patterns kept affect presentation rather than detection sensitivity.

Shared-D names and family colors

Completed bullish outlines are solid and bearish outlines dotted; Major adds one to the completed line width. Displayed formations sharing a D point share a name label. Its hover lists individual names and ordinals that connect to table columns; these are identifiers, not ranks. Each formation retains its own PRZ and levels. The four family colors separate Retracement, Extension, Extended C and Drives; Three Drives and ABCD share the Drives color. Pattern names offers Off, Marker and Name.

Potential Reversal Zone

The completed PRZ spans the outer prices of its canonical projections. Its hover explains the components. A projection collapsing to one price is widened into a band using Ratio tolerance. The harmonic name does not establish a future reversal, and a non-Setup formation can also have a PRZ. Show PRZ follows its own switch at every preset, including Minimal.

Preset-controlled features

Minimal turns triangle fill, Setup marker, levels table, forming patterns and projected D zones off. Standard enables the first three; Detailed enables all five. Custom follows the individual switches, with projections also requiring Draw while forming. Show levels and Show PRZ remain independent at every preset. A preset does not guarantee an eligible formation exists.

Disabled controls and transparency

Preset-controlled checkboxes are editable only under Custom. Forming patterns drawn requires effective forming; projected zones under Custom require forming too. Fill transparency is editable when triangle fill is effective, ranges from 0% solid to 100% invisible and defaults to 60%. Presets do not reset saved transparency. Finished formations lose triangle fill; PRZ and Target/Stop rectangles use separate shading. Disabled inputs retain their values.

Setup qualification

When D confirms, the ratios must qualify, D must be inside its PRZ and respect the applicable X boundary, and the rounded confirmation close must be off D in the pattern’s orientation without already leaving the exact D-to-C band. With Require trend context on, the family’s prior-trend requirement must also hold. A missing Setup can reflect D outside PRZ, D past X, close on D, an unreadable or opposite prior trend, or a formation already resolved before confirmation. Setup is a frozen qualification state, not a recommendation.

Prior-trend family rules

AHP classifies Gartley, Bat, Cypher, Shark and ABCD as continuation for this check: bullish shapes require a prior uptrend and bearish shapes a prior downtrend. Butterfly, Crab, Deep Crab, Alt Bat, Nen Star, 5-0 and Three Drives use the reverse requirement. These are Setup classification rules, not claims about what price will do next.

Swing structure and moving-average context

Swing structure compares the formation’s origin swings with earlier confirmed swings. Moving average compares D with the selected SMA or EMA of close at D; Both must agree requires both readings. The average length also sets its slope comparison lookback. Trend band and slope thresholds use ATR at D; zero slope skips that test. The reading is frozen at confirmation using the relevant earlier values. Show trend context affects display only; Require trend context controls qualification.

Entry and pattern-distance R

Entry references the confirmation-bar close rounded to the instrument’s tick. R is the absolute C-to-D price distance. A positive R cap × chart ATR can reduce it using confirmation-bar ATR; zero leaves it uncapped, and the table marks a capped calculation. R is not Entry-to-Stop risk: a Target labeled 1.0R is not a claim of a 1:1 reward-to-risk ratio or a return.

Target and Stop geometry

The three configured Target multiples are sorted into T1, T2 and T3 and placed beyond Entry in the formation’s orientation, with tick rounding. Equal multiples or rounding can put Targets together. Structure Stop uses D minus the ATR buffer for bullish shapes or D plus it for bearish shapes, enforces a minimum Entry-distance of 0.1R, and rounds outward to a tick. With structure off, Stop (R) instead measures a configured R distance from Entry. Changing Stop mode does not redefine R or the Targets.

Reference prices and labels

Prices are fixed at admission for the current inputs. Prices on labels controls the Entry price; Target and Stop labels show R figures, while exact prices remain in hovers and the table. The structure Stop’s displayed R distance can differ from Stop (R). For illustration, a C-to-D distance of 4 price units with the cap off places a 1.0R Target 4 units from Entry before tick rounding; Entry-to-Stop distance may be different. These are configured reference prices, not fills.

Formation status and expiry

After admission, Resolution tolerance adds an ATR buffer beyond C and D for later close-based resolution. A wick alone does not settle Status. The confirmation check uses the exact D-to-C band without that later buffer. Age ends a formation at the earlier of Bars to apply after confirmation or one more of its own X-to-D spans after D; it can age immediately if that span has already elapsed. Expiry is checked before later close-based resolution.

Reached is a separate record

Starting on the bar after D confirmation, confirmed bars’ highs and lows record level touches with a half-tick comparison tolerance. Earlier and confirmation-bar wicks are not counted retroactively. Tracking can continue after the formation resolves, ending at Stop, T3 or the same age horizon, whichever occurs first. When one bar touches a Target and Stop, their intrabar order is unknown; no fill or win/loss result is inferred.

Clear, Keep and retained drawings

Once reached: Clear removes each reached Target and clears the ladder at T3 or Stop. Keep retains the ladder and marks reached labels. Finished patterns lose triangle fill. Patterns kept selects retained drawings; Grey aged-out patterns and Hide aged levels and PRZ govern aged presentation. Aged hiding overrides Keep for chart overlays without erasing the eligible retained table record.

Levels table and hovers

At most the newest three eligible displayed formations occupy columns, ordered oldest to newest. The table requires effective Show levels table plus at least one of Show levels or Show trend context. Position and text size are editable when the table is enabled. Pattern/Status/Prior trend can remain when levels are hidden. Non-Setup prices are dashes; prior-trend warnings distinguish a missing required direction, No direction inside a band and Insufficient history. Hovers explain qualification and attribution.

Position size and currency

Show position size adds whole-unit calculations to the At your risk row and Stop hover; Full and JSON messages can include them with levels. Amount uses Amount per Setup. Percent uses Account size × Percent per Setup ÷ 100. Both budget sources start at zero. Budget values must already be in the instrument’s currency; point value is chart metadata, not a broker-specific lot conversion. One-unit reference risk equals displayed Entry-to-Stop distance × point value. Quantity is budget divided by that value, rounded down to whole units.

Sizing example and unavailable results

Illustrative arithmetic: Entry-to-Stop distance 2, point value 5 and budget 105 give one-unit reference risk 10 and quantity 10 before costs. A valid positive budget of 9 gives zero units. An unset/nonpositive budget, unavailable point value, unusable Stop distance or unsupported arithmetic precision/range gives a dash with a reason instead. These values are not an instrument specification or a recommended budget. The calculation does not read a broker account or place orders.

Forming candidates and projected D

Detailed, or Custom with forming enabled, displays unfinished X-A-B-C candidates. Dashed outlines and projected bands describe where enabled five-point ratio definitions still allow D; they can change or disappear and are not completed Setups. Forming patterns drawn selects one to three per reading. The optional projected-zone notification also requires a drawn zone.

Chart and history capacity

Use standard time-based bars or candles. Unsupported synthetic or non-time charts produce a configuration notice and no formations, levels or alerts. The detector uses the current chart’s price data and timeframe, with no higher-timeframe request, volume filter or session-specific model. Each reading selects up to three open drawings, tracks up to 64 unfinished records and retains 24 raw finished records. A resolved Setup may still be unfinished while levels are tracked; capacity-skipped admissions are disclosed in a notice. Search has a 17-pivot chain limit, and formations beyond drawing reach are skipped rather than shifted.

Output and state reference6 documented states

Swipe or scroll horizontally to see every column.

Auto Harmonic Patterns outputs and states
Output or stateWhen it appearsMeaning
OpenAdmitted formation remains within its lifecycleNo age expiry or qualifying close outside the later lifecycle band yet. Setup qualification is separate.
Closed above C / Closed below CA qualifying close passed C in the formation’s orientationThe formation has resolved by close. Its level-touch record may continue.
Closed below D / Closed above DA qualifying close passed D on the opposite sideA close-based formation resolution, distinct from a Stop touch.
Aged outThe age horizon was reached before a later resolutionThe formation expired by time. This is not a Stop touch.
SetupFrozen confirmation-time geometry and applicable prior-trend checks passedEntry, Target and Stop references can be calculated. The marker describes qualification, not a trade recommendation.
ReachedA later confirmed bar’s high or low touched a reference levelRecords touches, not fills. A Target and Stop reached on the same bar have unknown intrabar order.

Settings

These 60 inputs describe a fresh instance of the September 7 release. Saved chart settings can differ. Presets determine effective display switches; the Defaults and Behavior sections explain their overrides and parent dependencies. Inline family color pickers and the table text-size dropdown each have their own row below.

Detection7 inputs

Swipe or scroll horizontally to see every column.

Detection settings and defaults
SettingControlDefaultChoices, limits & availability
Swing strengthswingInputWhole number8Min 1 · Max 50
Bars to applyapplyBarsInputWhole number300Min 50 · Max 2000
Ratio tolerance %ratioTolInputDecimal8.0Min 0.0 · Max 15.0 · Step 0.5
Allow one skipped swing per legskipInputToggleOn—
ATR lengthatrLenInputWhole number14Min 2 · Max 100
Major swing strengthmajorSwingInputWhole number24Min 0 · Max 100
Pivot chain barschainBarsInputWhole number600Min 50 · Max 4000
Patterns · Retracement2 inputs

Swipe or scroll horizontally to see every column.

Patterns · Retracement settings and defaults
SettingControlDefaultChoices, limits & availability
Gartley · Bat · Alt BatretrInputToggleOn—
Retracement family colorretrColorColor#2962FF—
Patterns · Extension2 inputs

Swipe or scroll horizontally to see every column.

Patterns · Extension settings and defaults
SettingControlDefaultChoices, limits & availability
Butterfly · Crab · Deep CrabextInputToggleOn—
Extension family colorextColorColor#F23645—
Patterns · Extended C2 inputs

Swipe or scroll horizontally to see every column.

Patterns · Extended C settings and defaults
SettingControlDefaultChoices, limits & availability
Cypher · Shark · Nen Star · 5-0extcInputToggleOn—
Extended C family colorextcColorColor#FF9800—
Patterns · Drives3 inputs

Swipe or scroll horizontally to see every column.

Patterns · Drives settings and defaults
SettingControlDefaultChoices, limits & availability
Three DrivesdrivesInputToggleOn—
ABCDabcdInputToggleOff—
Three Drives and ABCD colordrivesColorColor#26A69A—
Patterns1 input

Swipe or scroll horizontally to see every column.

Patterns settings and defaults
SettingControlDefaultChoices, limits & availability
OrientationorientInputChoice / textBothBoth · Bullish (W) · Bearish (M)
Lifecycle4 inputs

Swipe or scroll horizontally to see every column.

Lifecycle settings and defaults
SettingControlDefaultChoices, limits & availability
Patterns keptkeptInputWhole number5Min 0 · Max 8
Resolution tolerance × ATRresTolInputDecimal0.0Min 0.0 · Max 2.0 · Step 0.05
Grey aged-out patternsgreyAgedInputToggleOnConditional
Hide aged levels and PRZhideAgedInputToggleOnConditional
Display8 inputs

Swipe or scroll horizontally to see every column.

Display settings and defaults
SettingControlDefaultChoices, limits & availability
PresetpresetInputChoice / textStandardMinimal · Standard · Detailed · Custom
Draw while formingformingInputToggleOffConditional
Forming patterns drawnformingMaxInputWhole number2Min 1 · Max 3 | Conditional
Fill trianglesfillInputToggleOnConditional
Fill transparencyfillTranspInputWhole number60Min 0 · Max 100 | Conditional
Projected D zoneprojInputToggleOffConditional
Pattern nameslabelModeInputChoice / textNameOff · Marker · Name
Line widthlineWidthInputWhole number1Min 1 · Max 3
Trade levels12 inputs

Swipe or scroll horizontally to see every column.

Trade levels settings and defaults
SettingControlDefaultChoices, limits & availability
Show levelsshowLevelsInputToggleOn—
Target 1 (R)targetR1InputDecimal0.382Min 0.1 · Max 5.0 · Step 0.01 | Conditional
Target 2 (R)targetR2InputDecimal0.618Min 0.1 · Max 5.0 · Step 0.01 | Conditional
Target 3 (R)targetR3InputDecimal1.0Min 0.1 · Max 5.0 · Step 0.01 | Conditional
Stop at structurestopStructInputToggleOnConditional
Stop (R)stopRInputDecimal0.25Min 0.05 · Max 2.0 · Step 0.05 | Conditional
R cap × chart ATRrCapInputDecimal0.0Min 0.0 · Max 20.0 · Step 0.5 | Conditional
Once reachedonCloseInputChoice / textClearClear · Keep | Conditional
Prices on labelslevelPriceInputToggleOnConditional
Target colourtargetColorInputColor#8C66FFConditional
Stop colourstopColorInputColor#D9453DConditional
Stop buffer × ATRstopBufferInputDecimal0.5Min 0.0 · Max 3.0 · Step 0.05 | Conditional
Setup8 inputs

Swipe or scroll horizontally to see every column.

Setup settings and defaults
SettingControlDefaultChoices, limits & availability
Require trend contextrequireTrendInputToggleOn—
Show PRZprzInputToggleOn—
Setup markermarkerInputToggleOnConditional
Trend basistrendBasisInputChoice / textSwing structureSwing structure · Moving average · Both must agree
Trend averagetrendMaTypeInputChoice / textEMASMA · EMA | Conditional
Trend average lengthtrendMaLenInputWhole number50Min 2 · Max 500 | Conditional
Trend band × ATRtrendMaBandInputDecimal0.0Min 0.0 · Max 5.0 · Step 0.1 | Conditional
Trend slope × ATRtrendMaSlopeInputDecimal0.0Min 0.0 · Max 5.0 · Step 0.1 | Conditional
Position size5 inputs

Swipe or scroll horizontally to see every column.

Position size settings and defaults
SettingControlDefaultChoices, limits & availability
Show position sizesizingInputToggleOff—
Risk budgetriskBasisInputChoice / textAmountAmount · Percent | Conditional
Amount per SetupriskAmtInputDecimal0.0Min 0.0 · Step 50.0 | Conditional
Account sizeaccountInputDecimal0.0Min 0.0 · Step 1000.0 | Conditional
Percent per SetupriskPctInputDecimal1.0Min 0.0 · Max 100.0 · Step 0.05 | Conditional
Levels table4 inputs

Swipe or scroll horizontally to see every column.

Levels table settings and defaults
SettingControlDefaultChoices, limits & availability
Show levels tableshowTableInputToggleOnConditional
Position and sizetablePosInputChoice / textTop rightTop left · Top center · Top right · Mid left · Mid center · Mid right · Bottom left · Bottom center · Bottom right | Conditional
Levels table text sizetableSizeInputChoice / textSmallTiny · Small · Normal · Large | Conditional
Show trend contextshowTrendInputToggleOnConditional
Alerts2 inputs

Swipe or scroll horizontally to see every column.

Alerts settings and defaults
SettingControlDefaultChoices, limits & availability
FormatalertDetailInputChoice / textBriefBrief · Full · JSON
Projected-D alertprojAlertInputToggleOff—

Alerts and limitations

What can notify you, what can change the output, and what the indicator cannot establish.

Dynamic alert events

Pattern admission

A realtime confirmed-close admission event. Family switches and Orientation do not suppress it.

Lifecycle

A realtime formation lifecycle event. Drawing filters do not suppress this event type; later Target and Stop touches do not create notifications.

Projected-D alert

Opt-in entry into a drawn projected zone on a confirmed bar. Requires effective forming/projection display, so drawing choices matter for this event type.

Limits to keep visible

  • Completed drawings appear after pivot confirmation and extend back to past pivots. Optional forming candidates and projected zones can change or disappear; there is no blanket non-repainting claim.
  • A pattern match does not establish an edge. PRZ does not predict a reversal, Setup is not a recommendation, and configured levels are not measured outcomes.
  • Reached records price touches without fills, position execution, intrabar order, performance statistics or win/loss totals.
  • Sizing assumes instrument-currency budgets and excludes FX conversion, fees, spread, slippage, gaps, fills, liquidity, margin, fractional quantities and combined-position exposure. A drawn Stop is not a guaranteed maximum loss; broker unit conventions can differ.
  • Loaded history, data revisions, search horizons, drawing selection and bounded tracking affect coverage. Increasing Pivot chain bars or Patterns kept does not create an exhaustive historical catalogue.
  • Prior trend is frozen context associated with formation confirmation, not the direction of the market now. Changing inputs recalculates chart history.
  • Alert queue and rate limits can delay or omit events. Notification delivery and a complete historical event log are not guaranteed.

Troubleshooting

Start with what you see on the chart. Each answer explains the likely cause and the first setting, timeframe, or data condition to check.

Why is nothing drawn?

Check the configuration notice, standard time-based chart type, family/orientation filters and confirmed pivots. A valid configuration does not guarantee a matching formation exists. Patterns kept changes finished drawings, not detection sensitivity.

Why did a pattern appear several bars after D?

D must first confirm. With Swing strength 8, the completed formation appears eight bars after D and is then drawn back to its pivots. Its drawing location is not its availability time.

Why does a pattern have no Entry, Targets or Stop?

Read its Setup checks in the hover. A non-Setup formation has no level prices. Show levels, drawing selection and retention can also hide an eligible ladder.

Why is the table missing?

Minimal disables the table. Custom requires Show levels table. An eligible formation and at least one of Show levels or Show trend context are also required.

Why is Major not running?

Major swing strength below 8 turns that reading off. At 8 or above it must exceed Swing strength; an invalid enabled pair produces a configuration notice.

Why is fill invisible or still set to 88?

Check the effective preset, saved Fill transparency and whether the formation has finished. The 60% default applies to a fresh instance; existing instances retain saved values. Finished formations lose triangle fill, and the transparency control does not change PRZ or Target/Stop box shading.

Why are inputs greyed out?

Preset-controlled switches can be edited only under Custom. Other controls require their parent feature to be enabled. Disabled inputs keep their values; the preset determines the effective display meanwhile.

Why did level touches continue after the formation closed?

Status and Reached have separate endings. Reached can continue after close-based formation resolution until Stop, T3 or the shared age horizon. A wick touch does not itself settle formation Status.

Why does position size show a dash or zero?

A dash means an unset/nonpositive budget or another unavailable or unsupported input. A valid positive budget smaller than one unit’s reference risk gives zero whole units. Percent mode still needs a positive Account size; the 1% default alone supplies no budget.

Why did a hidden pattern still alert?

Family and Orientation switches hide drawings without suppressing pattern-admission or lifecycle events. Projected-D alerts differ: they are opt-in and require a drawn projected zone. Recreate a running alert to adopt changed chart settings.

Risk disclosure

Auction Foundry LLC provides educational charting tools and general market commentary only. This is not investment, financial, legal or tax advice, and nothing here is a recommendation, offer or solicitation to buy or sell any instrument. Auction Foundry is not registered with the SEC as an investment adviser, nor with the CFTC as a commodity trading advisor, and is not an NFA member.

Trading involves risk, including loss of principal. Losses can exceed a modeled stop and, for leveraged or margin products, can exceed the amount initially deposited or invested. Indicators can be wrong, delayed or unsuitable for your circumstances, and past or hypothetical results do not predict future results. Free access does not change any of this. Consider your objectives and consult a licensed professional before acting. Using these tools does not create an advisory or brokerage relationship.

Auction Foundry LLC is an independent publisher and is not affiliated with, endorsed by, or sponsored by TradingView, Inc. “TradingView” is a trademark of TradingView, Inc., used here only to identify the platform our scripts are published on. Scripts are published to TradingView as a community author on the same terms as any other author.

Read the full Risk Disclosure for the dated, versioned document this summarizes.