OPEN-SOURCE SCRIPT

AMD Session Map [AFD]

728
snapshot

Three measured boxes per session cycle — Accumulation, Manipulation, Distribution — drawn only where the rules qualify one, each on a confirmed bar. The same read runs on higher-timeframe bars as a thin coloured rule along the bottom of the pane.

The three phases
Accumulation — the balance box. Adaptive RTH takes a contained window of about 40 minutes anywhere in the session, whole bars, four-bar minimum, no wider than the 30th percentile of the last 30. Opening 60 / 90 min instead take a fixed stretch from 09:30 New York, one cycle a day.

Manipulation — the sweep box, from the swept boundary to the extreme reached. The panel names the boundary and the time. No sweep within 90 minutes of the balance completing: timeout.

Distribution — the post-reclaim box, from the close back inside the balance to the end of the cycle. No reclaim within 30 minutes of the first sweep bar: timeout. Resolution — closed up, closed down, or named for what it did: unfinished at the close, both boundaries swept, closed back on the sweep side, deadline passed. Never rounded to a side.

The higher-timeframe ribbon
  • One thin rule per period along the bottom of the pane. Daily is on by default; Weekly, Monthly and Quarterly are switches. Each period's range comes from the first four completed bars of its container — Daily in the month, Weekly in the quarter, Monthly in the year, Quarterly in a four-year cycle. Unresolved periods are neutral grey. A rule holds no price coordinate, so the ribbon never moves the price scale. Show it as panel rows, as the ribbon, as both, or not at all. It never feeds the intraday detector.


Higher-timeframe requests — the lookahead disclosure
  • Four requests, one per period, each for a completed-bar tuple. Every value is offset by one bar with the history-referencing operator inside the request expression, paired with barmerge.lookahead_on — the pairing the Pine Script documentation names as the way to return only confirmed values on all bars, whatever the bar state. Checked on Bar Replay: stepping through 25–26 August left the historical ribbon colors and the panel's higher-timeframe rows identical to the same bars outside replay. The consequence, by design: a higher-timeframe value is always one completed higher-timeframe bar behind.


Scope
  • Standard chart type, 1 to 15 minutes, exchange timezone America/New_York. The timezone is the whole test — asset class is not checked. []Exchange-designated regular-session bars only, inside the nominal 09:30–16:00 window. Early closes follow the exchange's own last-regular-bar flag; pre/post-market bars are excluded even when extended hours are displayed.
  • Outside that scope the panel reports UNSUPPORTED and intraday fields stay empty rather than carry a value the model did not measure.


snapshot
Adaptive RTH

snapshot
Opening 60

snapshot
Opening 90 - Selective volatility

Settings
  • Accumulation model — Adaptive RTH, which can map repeat cycles in one day, or Opening 60 / 90 min, which map one.

    Confirmation profile — Structure + volatility context applies no size filter; ATR ratios are reported and change nothing. Selective volatility-confirmed adds two: the sweep must clear the boundary by 0.10x ATR, and the bar closing past the far boundary needs a body of at least 0.50x ATR and at least half its own range. Structure only keeps ATR out of every decision.

    Presentation — Map draws the boxes over your native candles; Phase candles also recolours the confirmed sweep and distribution bars; Full emphasis adds a background tint.

    Panel — the live phase, the balance range, the swept boundary and its time, the reclaim, and one row per enabled higher-timeframe period. Seven positions, or switched off; it still draws on an unsupported chart.

    Data Window — nineteen fields: five geometry levels, six Wilder ATR(14) measurements, and two accumulation levels per higher-timeframe period.


Data and limitations
  • Rule-based chart geometry; AMD terms do not establish participant intent or future outcome. Phase names label what the rules measured — a contained range, trade beyond its boundary, a move after the reclaim — and nothing about who traded or why. Every decision is made on a confirmed bar. A cycle in progress is shown as in progress. A higher-timeframe value lags by one completed higher-timeframe bar, as described above. Six cycles are retained and older ones dropped — up to three boxes each, against the 60 this script declares. No alerts, signals, entries, exits, scores, rankings, projections, or performance claims. It does not tell anyone what to do with what it draws.


Originality An Auction Foundry implementation of the Accumulation / Manipulation / Distribution framework. The adaptive balance admission, the sweep and reclaim deadlines, the volatility latching and the calendar read are all in the published source. Free to use, open-source under the Mozilla Public License 2.0.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.