Skip to main content
AuctionFoundry
Menu

INDICATOR MANUAL

Automatic pitchfork indicatorAuto Pitchfork + Trade Levels [AFD] · full manual · published to TradingView

Read the pitchfork this chart’s own confirmed pivots build, in the construction you select, find the bar it became usable, and follow the touches and the ending that came after.

21 documented settingsPublished on TradingView · Sep 21, 2026

Start here

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

A pitchfork needs three alternating swing pivots: P0, then P1, then P2. This finds them with a strict swing rule, checks the structure between them, and draws the fork only when a triple passes every rule.

The median line runs from the origin through the midpoint of P1 and P2. The upper and lower parallels are parallel to it, and dotted warning lines sit one center-to-parallel distance beyond each outer parallel. Every one of those lines shares a single slope, so the spacing is exact arithmetic rather than a fit.

Variant selects where the median starts: Standard at P0, Schiff at the midpoint of P0 and P1 in price on P0’s bar, Modified Schiff at that midpoint in both bar and price.

A pivot is only confirmed once Swing length further bars have printed, so a fork’s stated formation bar is Swing length bars after P2 and its drawing appears on the bar after that, as the confirming bar closes. The fork is late by construction; that is the cost of only using pivots that are settled.

Forks end. A close past a warning line by a small fixed volatility allowance ends one, as does age, as does a newer valid triple replacing it. An ended fork is kept quietly on the chart, newest first, up to Retained ended forks.

Fresh-install defaults9 documented defaults

Swipe or scroll horizontally to see every column.

Auto Pitchfork + Trade Levels fresh-install defaults
AreaDefaultResult
Swing length / Longer layer5 / offOne layer on the chart timeframe. A pivot confirms five bars after it prints.
VariantStandardThe median starts at P0. Schiff and Modified Schiff move that origin.
Upper parallel / Median line / Lower parallelall onAll three lines, their tags, leaders, warning lines and touch marks are drawn. Off hides a line’s drawings, and under a sloped basis any target on it with its tag and band; the panel keeps every row.
Equal-price pivots / Anchor selectionReject ties / Latest tripleEqual prices are refused, and the most recent valid triple wins.
Show Entry, Stop and TargetsonThe levels are drawn and the panel carries their prices.
Target basisActual stop (R)What a target is. Actual stop (R) and ATR count 1, 2 and 3 units from Entry and freeze. Median line and Structure put the targets on the fork’s own lines, so they slope.
Retained ended forks2Two ended forks stay on the chart after they close.
Panel / Panel position / Text sizeon / Auto / SmallThe table sits on the setup’s Entry and Stop side — low for a long setup, high for a short one — where it can cover those tags.
Alert events / DetailAll events / BriefEvery event kind is queued, in the short text form.

How it works

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

Three pivots, strictly confirmed

A swing high must be strictly higher than every bar in its window, and a swing low strictly lower. Bars with missing data disqualify the window rather than being skipped. Equal-price pivots decides whether an exact tie is refused or the newer side wins.

Six rejection rules, tested in a fixed order

A triple is refused if either leg is too small against volatility, then if either leg is too short in bars, then if P2 does not hold its side of P0, then if the fork’s width falls outside its volatility bounds, then if the structure between the pivots was broken or its bars are missing, and last if the confirming close was already outside the construction. The first rule a triple fails is the one recorded, which is the rule the panel names for the most recent examined triple. Nothing is constructed at all while volatility is unavailable.

The origin depends on the variant

Standard anchors at P0. Schiff anchors at the P0–P1 price midpoint on P0’s bar. Modified Schiff anchors at that midpoint in both bar and price, which puts the origin on a half-bar under an odd span.

Touches are counted inside a stated band

A touch is a bar whose range reaches a line within a fixed multiple of volatility, with a minimum gap in bars between counts on the same line. The count, its band and its sample appear in the Data Window and in the Full and JSON alert records.

A fork ends once, and the record freezes

Whichever ending comes first is the one recorded; the panel keeps the setup’s prices and the exchange-timezone time each level was first reached.

Two layers, run independently

With Longer layer on, a second detection runs at a multiple of Swing length. The two never share state, and the panel shows one table with a column each.

What Closed means

Closed means level tracking ended, not that an order was closed. There are no orders, no position and no size anywhere in this script.

Target cells

Each target cell carries its own word beneath the price: Pending while tracking, Reached <time> once a bar has reached it, Never opened on a setup that never opened, and Unreached · closed on one that closed without reaching it.

The fork’s own lifecycle

A fork’s own lifecycle is separate from its setup’s. It is reported as the alert event name — Fork formed, then Ended above, Ended below, Aged out or Superseded — and as the Data Window field State code, which reads 0 active, 1 ended, 2 aged out and 3 superseded. An ended fork is kept quietly on the chart, newest first, up to Retained ended forks.

Before the first setup

Before a layer has admitted a setup it prints a waiting note instead: insufficient confirmed pivots, waiting for a new confirmed pivot, or the number of triples examined with Newest rejected: and the rule that refused the newest one — one of volatility unavailable, minimum movement, leg length, P2 versus P0, width, structure or missing data or construction close.

Output and state reference6 documented states

Swipe or scroll horizontally to see every column.

Auto Pitchfork + Trade Levels outputs and states
Output or stateWhen it appearsMeaning
TrackingA triple passed every rule, its confirming bar closed, and the fork that draws the levels is still liveReaches are still being recorded. Under a sloped basis the target rows read the fork’s lines at the latest bar.
Closed, T1 Reached … Closed, T3 ReachedThe outermost target the setup carries was reachedLevel tracking ended there. The panel keeps every price and first-reached time; the number is the last tier that setup carried, which is T1 under Median line.
Closed, Stop ReachedA bar reached the StopLevel tracking ended. Every remaining level drawing is cleared.
Closed, Order UnknownOne bar reached the Stop and a target that had not been reached beforeThe sequence inside that bar is not knowable from bar data, so neither is claimed.
Closed, Fork EndedThe fork ended or aged outThe setup closes on that bar and records no later reach. Under a sloped basis the target was that fork’s line, and the line is gone.
Levels UnavailableNo target line lay beyond Entry when the fork formed, or tick or cap metadata was missingThe setup never opened. Its Stop row reads Never opened rather than Unreached · closed.

Settings

All 21 inputs are listed below in their six source groups. Every input carries a tooltip in the settings dialog. Greyed-out controls are inactive because the switch that governs them is off.

Detection4 inputs

Swipe or scroll horizontally to see every column.

Detection settings and defaults
SettingControlDefaultChoices, limits & availability
Swing lengthswingInputWhole number5Min 2 · Max 30
Longer layerlongerInputToggleOff—
Equal-price pivotsequalInputChoice / textReject tiesReject ties · Latest equal pivot
Anchor selectionanchorsInputChoice / textLatest tripleLatest triple · Recent valid triple
Fork4 inputs

Swipe or scroll horizontally to see every column.

Fork settings and defaults
SettingControlDefaultChoices, limits & availability
VariantvariantInputChoice / textStandardStandard · Schiff · Modified Schiff
Upper parallelupperInputToggleOn—
Median linemedianInputToggleOn—
Lower parallellowerInputToggleOn—
Lifecycle1 input

Swipe or scroll horizontally to see every column.

Lifecycle settings and defaults
SettingControlDefaultChoices, limits & availability
Retained ended forksretainedInputWhole number2Min 0 · Max 5
Trade levels2 inputs

Swipe or scroll horizontally to see every column.

Trade levels settings and defaults
SettingControlDefaultChoices, limits & availability
Show Entry, Stop and TargetslevelsInputToggleOn—
Target basisbasisInputChoice / textActual stop (R)Actual stop (R) · ATR · Median line · Structure | Conditional
Display8 inputs

Swipe or scroll horizontally to see every column.

Display settings and defaults
SettingControlDefaultChoices, limits & availability
Pitchfork colorforkInputColor#5A8DFF—
Pitchfork line stylestrokeInputChoice / textSolidSolid · Dashed · Dotted
Line widthwidthInputWhole number2Min 1 · Max 4
LabelslabelsInputToggleOn—
Label inset (bars)labelInsetInputWhole number2Min 1 · Max 50 | Conditional
PanelpanelInputToggleOn—
Panel positionpositionInputChoice / textAutoAuto · Top right · Top left · Bottom right · Bottom left | Conditional
Text sizetextSizeInputChoice / textSmallTiny · Small · Normal
Alerts2 inputs

Swipe or scroll horizontally to see every column.

Alerts settings and defaults
SettingControlDefaultChoices, limits & availability
Alert eventsalertEventsInputChoice / textAll eventsAll events · Formation and ending · Touches · Off
DetaildetailInputChoice / textBriefBrief · Full · JSON

Alerts and limitations

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

Named alert conditions

Fork formed

One or more forks were confirmed on this bar.

Median reached

One or more first-median touches occurred on this confirmed bar.

Parallel touch

One or more line touches occurred on this confirmed bar.

Fork ended

One or more forks ended on this bar, by any of the ending rules.

Limits to keep visible

  • Whether this build repaints has not been observed on a replay of this build and is not claimed either way. What was observed on an earlier build is narrower: a fork’s stated formation bar is Swing length bars after P2, the drawing appears on the following bar as the confirming bar closes, and once a fork was drawn its anchors and parallel origins did not move on any later bar. That was two forks on one instrument on one timeframe.
  • A fork appears only after its third pivot confirms, so the drawing is always late relative to the bar it anchors on. That is the design, not a defect.
  • Entry, Stop and the targets are chart geometry. Each target is a fixed multiple of the selected unit, or a fork line itself. They describe no measured outcome and are not a recommendation to act.
  • Touch counts describe this chart’s history inside the stated band. They are not a forecast, and no count is aggregated across formations.
  • Pine cannot read a label’s pixel size or a manual vertical zoom, so tag spacing uses frozen volatility, a tick minimum and an estimate of the visible range. Readability at an extreme zoom is not guaranteed and is not claimed.
  • Geometry is linear price only. On a logarithmic scale the drawn lines are still computed linearly.
  • One request.security call reads a daily volatility value, used only to cap the R unit. Its behavior above the daily timeframe has not been observed.
  • Notification delivery depends on your TradingView plan, network and notification settings, which sit outside the script.

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 there no fork on my chart?

No triple passed. The panel names how many were examined and which rule refused the last one. A shorter Swing length finds more pivots; it does not relax any rule.

Why did the fork appear so late?

A pivot is only confirmed Swing length bars after it prints, and the drawing waits for that bar to close. The stated formation bar and the drawing bar differ by one for that reason.

Why did my fork disappear?

It ended and Retained ended forks is at or below the number of forks that have ended since. At zero, an ended fork and its level drawings disappear together while the panel keeps that setup’s result.

A tag sits under the panel.

Pine cannot measure where a table and a label land on screen. Panel position Auto puts the table on the setup’s Entry and Stop side, where it can cover those tags; a fixed top corner can cover the target tags of a long setup.

T1 shows as unreached, but price went through it.

A level is reached on a confirmed bar whose range covers it. A wick inside the bar that formed the fork does not count, and neither does a bar with missing data.

Why does the JSON say target when there are three?

The JSON keeps schema 2 so existing parsers do not break: target is T2 and r is the legacy capped unit, and target is null when T2 is not a tier this setup carries. The Full text record names the selected basis and every tier.

Under Structure or Median line, a target row prints an em dash and its hover says why.

A fork line that does not already lie beyond Entry when the fork forms is not a target: counting it would record it reached on the setup’s first bar. The remaining tiers keep their numbers. If none survives, the setup reads Levels Unavailable.

The target price in the panel keeps changing.

Under a sloped basis the target is the fork’s line, not a frozen price, so the panel shows where that line sits at the latest bar. The row hover says so.

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.