Auto Andrews' Pitchfork Adaptive Channel# Auto Andrews' Pitchfork — Adaptive Median-Line Channel, Regime & Calibration
## What it is
On TradingView an Andrews' Pitchfork is a manual drawing tool: you place three points by hand and it draws a median line with two parallel tines. This script automates that geometry and, more importantly, surrounds the raw lines with the decision context a drawn pitchfork can never give you — whether the channel currently fits the market, whether a touch is likely to revert or break, and how the median and tines have actually behaved on the symbol you are looking at.
It detects the swing pivots, builds the channel, auto-selects the variation (Standard / Schiff / Modified Schiff) whose median best bisects the recent price path, and then runs a regime, reversion, break-strength and calibration stack on top of that one channel. It works on any symbol and any timeframe; every raw-data series is user-selectable in Settings.
## Why these components are combined (how the parts work together)
A bare auto-pitchfork only answers "where are the lines." On its own it shows the same picture in a quiet range, where price rotates back to the median, and in a strong trend, where price rides a tine and keeps going — the classic median-line failure. Every layer in this script exists to remove one specific blind spot of the bare geometry, and each layer feeds the next. They are not independent indicators stacked together; they are all derived from, or applied to, the same auto-built channel.
- **Auto-geometry (pivot detection + variation fit)** draws the channel and chooses the variation that best fits the actual price path, so the median is meaningful rather than an arbitrary hand placement.
- **Regime (efficiency ratio + ADX + volatility clustering)** decides whether a tine touch should be expected to fade (revert) or be ridden (continue) — the question the geometry alone cannot answer.
- **Reversion math (variance ratio + Ornstein-Uhlenbeck half-life)** is the statistical check on that decision: is the series actually mean-reverting, and if so, in roughly how many bars does a stretch to the median decay.
- **Break-strength scoring** rates how decisive a move beyond a tine is — magnitude versus ATR, volume participation, range expansion, the close's position within the bar (an anti-wick check), and a compression-then-release pattern. This turns "price crossed the tine" into a graded Fade / Ride / Invalid read instead of a binary one.
- **Volume nodes (POC, HVN/LVN)** classify whether each tine sits on a high-volume acceptance shelf (reaction likely) or a low-volume gap (likely sliced through), so proximity becomes a quality read.
- **Confluence (anchored VWAP, volume POC, higher-timeframe swing levels)** marks where the auto-geometry agrees with independent reference levels.
- **Calibration** measures, past-only, how often the median and each tine were actually respected on this symbol, reported with Wilson confidence intervals and a containment percentage, so the reliability read is earned from data rather than assumed.
The histogram of these reads is the synthesis: the dashboard ranks and states the channel's current condition in plain terms, but every figure is descriptive context, never a trade instruction.
## How to use it
1. Add it to any chart and set your data sources under "Data Source (any market)." For symbols with no native volume (some cash indices and FX feeds), enter a volume-bearing proxy in "Borrow volume from symbol."
2. Read the channel as a map: the median is equilibrium, the tines are the channel edges, and the warning lines mark over-extension.
3. Read the Status row: FADE means expect rotation inside the channel; RIDE means a strong break in a trend (the tine is being ridden); INVALID means the channel broke and a re-anchor is expected.
4. Use Regime, Half-life and Var-ratio to judge whether a tine touch is a fade or a continuation; use the volume-node tag and Confluence to judge whether a level is likely to hold; use Respect and Containment to judge whether the fork fits this symbol at all.
5. Treat every value as probabilistic context to combine with your own analysis and risk management.
## Optional context (off by default)
Two optional layers extend the tool without cluttering the default view:
Higher-timeframe context forks overlay lightweight median-and-tine outlines of the same auto-geometry on 5× and/or 15× the chart timeframe, so you can see how the current channel sits inside the larger structure. Only the higher-timeframe pivots are pulled (non-repainting, confirmed bars), and the outlines are drawn in time coordinates so they align across resolutions. They are intentionally minimal — no fills, glow, or analytics — because the full regime, break-strength and calibration stack stays on the current-timeframe fork, which is the one the dashboard describes. Enable them only when you want the multi-scale picture; on very high chart timeframes a 15× resolution can be non-standard and that outline will not populate.
Re-anchor on break lets a fresh fork begin building from post-break structure whenever the channel is invalidated, rather than only when new prominent pivots form. The broken channel stays on screen (dashed) until enough post-break pivots confirm to render the new one — there is an inherent pivot-confirmation lag, so the new fork appears a few bars after the break, not at the exact break bar. A minimum-bars guard prevents repeated re-anchoring in choppy conditions.
## Settings for any market
The High, Low and Price source inputs select the raw series the engine runs on, so it is not tied to one instrument. The volume-borrow input is blank by default and only activates on symbols that truly report no native volume. All optional layers degrade gracefully when their data is unavailable, and a data-health read flags when volume is unreliable.
## Originality
This is an original implementation. The contribution is not any single layer but the closed loop built around an automatically generated pitchfork: auto-geometry feeds a regime and break-strength engine that classifies the channel state, a half-life and variance-ratio core that quantifies reversion, volume-node context that grades each tine, and a past-only calibration tracker that reports how the lines have actually behaved — all from the one channel, rather than as separate tools placed side by side.
## Limitations (honest)
Pivots confirm after the configured right-bars lag and are non-repainting by construction. Volume-based layers require real volume. Calibration figures are descriptive of past behaviour only — they are not a backtest and not a probability of future results. Every read is probabilistic context.
## Disclaimer
This is a study / indicator for chart analysis and education only. It is not a strategy, not a recommendation, and not financial advice. It places no orders and guarantees no result. Markets involve risk, and a level's past behaviour does not assure future behaviour. Do your own research and manage your own risk.
Chỉ báo




