INDICATOR MANUAL
AMD indicatorAMD Session Map [AFD] · full manual · published to TradingView
Read a session’s balance, the sweep that left it, and the stretch after price closed back inside—three measured boxes on confirmed bars, with every cycle that did not finish cleanly named rather than rounded to a side.
Start here
What the indicator does, the questions it can help answer, and its fresh-install defaults.
AMD is Accumulation, Manipulation, Distribution. The script draws up to three boxes per cycle: the balance range it accepted, the move beyond one of that range’s boundaries, and the stretch after a close came back inside it. Each box is opened and closed on a confirmed bar, and a box is drawn only where the rules qualify one—there is no cycle every day and no phase in every cycle.
It reads only exchange-designated regular-session bars inside the nominal 09:30–16:00 window, on a standard chart of 1 to 15 minutes whose symbol carries the America/New_York exchange timezone. The timezone is the whole scope test; asset class is not checked. Off that scope the status panel reports the failed condition and the intraday fields stay empty rather than carrying a value the model never measured.
Two deadlines keep the reading honest. A sweep has 90 minutes from the moment the balance completes; a reclaim has 30 minutes from the first sweep bar. Miss either and the cycle is named for what it did—no qualifying sweep in 90 min, no reclaim in 30 min, both range boundaries swept, closed back on the sweep side, unfinished at close—instead of being resolved to a direction it never earned.
The same A/M/D geometry runs separately on daily, weekly, monthly and quarterly bars and is shown as a thin colored rule per period along the bottom of the pane, as panel rows, as both, or not at all. Each period reads the first four completed bars of its calendar container—Daily in the month, Weekly in the quarter, Monthly in the year, Quarterly in a four-year cycle. That read never feeds the intraday detector.
Fresh-install defaults8 documented defaults
Swipe or scroll horizontally to see every column.
| Area | Default | Result |
|---|---|---|
| Accumulation model | Adaptive RTH | Takes a contained stretch of about 40 minutes anywhere in the session, and can map a second cycle the same day once the first one finishes. |
| Confirmation profile | Structure + volatility context | Applies no size filter. Where price went and the two deadlines decide every phase; the ATR ratios are reported in the Data Window and change nothing. |
| Presentation | Phase candles | Draws the boxes and recolors the confirmed sweep and post-reclaim bars. Accumulation bars are never recolored. |
| Retained cycles | 6 | Keeps six finished cycles drawn behind the live one, up to three boxes each, against the 60 boxes this script declares. |
| HTF context | Panel + ribbon | Shows each enabled higher-timeframe period as one panel row and one colored rule at the bottom of the pane. |
| Higher-timeframe periods | Daily on · Weekly, Monthly, Quarterly off | One request per enabled period. Each reads the first four completed bars of its calendar container and none of them feeds the intraday detector. |
| Status panel | On · Top right | Names the live phase, the balance range, the swept boundary and its time, the reclaim, and one row per enabled higher-timeframe period. |
| Colors | Blue · amber · violet, with green and rose outcomes | Accumulation, manipulation and distribution each own a color; a cycle that closed up or down switches its distribution box to the outcome color. |
How it works
How the indicator turns chart data into the states and drawings you see.
The scope test, and what happens outside it
Standard chart type, a minute timeframe of 1 to 15, and syminfo.timezone equal to America/New_York. Inside that, only session.ismarket bars falling within 09:30–16:00 New York are read, so pre- and post-market bars are excluded even when extended hours are displayed and an early close follows the exchange’s own last-regular-bar flag. Fail any part and the panel reads UNSUPPORTED and names the condition.
Adaptive RTH balance admission
The candidate window is about 40 minutes rounded up to whole chart bars, never fewer than four. It is admitted when the most recent stretch of it stays inside the high and low of the earlier bars, and the whole window is no wider than the 30th percentile of the last 30 eligible same-length windows. Until 30 windows exist the panel reads Baseline n/30 and nothing is drawn.
The two fixed opening models
Opening 60 min and Opening 90 min take the high and low of the first hour, or hour and a half, from 09:30 New York, counting only bars fully inside that window. They map one cycle a day and need no baseline. Fewer than four contained bars, or a flat window, ends the day as no usable opening range.
The sweep, and its 90-minute deadline
From the bar the balance completes, the script waits for a strictly one-sided move beyond a boundary. The sweep box runs from the swept boundary to the extreme reached and extends while the phase is open. A bar reaching both boundaries is terminally ambiguous; reaching the 90-minute mark with no qualifying sweep ends the cycle as a timeout.
The reclaim, and its 30-minute deadline
A close back inside the balance opens distribution, and the post-reclaim box spans from that close to the end of the cycle. A bar can sweep and reclaim at once, in which case distribution opens on the following bar. Touching the opposite boundary first is ambiguous, and 30 elapsed minutes with no reclaim ends the cycle as a reclaim timeout.
How a cycle finishes, and what is never assumed
A cycle closes upward or downward only on a close past the far boundary after the reclaim. Otherwise it carries the name of what it did: both boundaries swept, closed back on the sweep side, a passed deadline, or unfinished at the close. In Adaptive RTH a finished cycle stays frozen until a later confirmed close leaves its balance range, which is what allows a second cycle the same day.
What the Selective profile adds
Selective volatility-confirmed keeps the same geometry and adds two size filters measured against a Wilder ATR(14) built from regular-session bars only: the sweep must clear the boundary by at least 0.10× ATR, and the bar closing past the far boundary needs a body of at least 0.50× ATR that is at least half that bar’s own range. Structure only keeps ATR out of every decision and leaves the six volatility fields blank.
The higher-timeframe ribbon and its one-bar lag
Each enabled period is one request for a completed-bar tuple, four at most. 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 whatever the bar state. The consequence, by design, is that a higher-timeframe read is always one completed higher-timeframe bar behind. Each rule holds no price coordinate, so the ribbon never moves the price scale, and an unresolved period takes the neutral grey.
Confirmed bars, and a fixed drawing budget
Every decision is made on a confirmed bar and left in place; a cycle in progress is shown as in progress. Retained cycles caps the drawing budget at three boxes per cycle plus the live one, against the 60 boxes the script declares, and the oldest cycle’s boxes are deleted rather than allowed to fall off silently.
Output and state reference10 documented states
Swipe or scroll horizontally to see every column.
| Output or state | When it appears | Meaning |
|---|---|---|
| Accumulation box | A balance window is admitted on a confirmed bar | The contained range every sweep and reclaim is measured against. Its bars are never recolored, because the range is known only once they have closed. |
| Manipulation box | A strictly one-sided move beyond a balance boundary | From the swept boundary to the extreme reached, extending while the phase is open. The panel names which boundary and the time. |
| Distribution box | A close back inside the balance | From the reclaim to the end of the cycle. It takes the outcome color if the cycle closed up or down, and keeps the distribution color otherwise. |
| Phase candles | Presentation set to Phase candles or Full emphasis | Confirmed sweep and post-reclaim bars carry their phase color; Full emphasis adds a background tint behind them. |
| Closed upward / Closed downward | A close past the far boundary after the reclaim | How the cycle finished, stated about bars that have closed. It is not a direction for what comes next. |
| Timeout and ambiguity names | A deadline passes, both boundaries are swept, or price closes back on the sweep side | The cycle is named for the condition that ended it rather than rounded to a side. |
| HTF rule and label | That period is enabled and its container has a four-bar range | One thin colored rule per period along the bottom of the pane, named beside it, colored by that period’s phase or outcome and neutral grey when unresolved. |
| Status panel | Show status panel on, or the chart is unsupported | The live phase against the chart timeframe, the balance range, the swept boundary and time, the reclaim, and one row per enabled period. The row-0 hover carries the model, the profile and the internal state code. |
| UNSUPPORTED | Non-standard chart, a timeframe outside 1–15 minutes, or a symbol not on America/New_York | The abstention. The panel names the failed condition, and no intraday geometry is drawn or reported. |
| Data Window fields | Always on for the fields the profile populates | Nineteen fields: five geometry levels, six Wilder ATR(14) measurements, and two accumulation levels per higher-timeframe period. |
Settings
The 16 inputs below match the published Pine surface across Quick setup, History and HTF context, Status panel, and Colors. The measured constants are fixed in source and disclosed rather than exposed: the 40-minute candidate window and its four-bar minimum, the 30th percentile of the last 30 windows, the 90-minute sweep and 30-minute reclaim deadlines, the Selective thresholds of 0.10× and 0.50× ATR with a 50% body-to-range floor, the Wilder ATR(14) built from regular-session bars, and the four-bar container range each higher-timeframe period is measured against.
Quick setup3 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Accumulation modelaccumulationModeInput | Choice / text | Adaptive RTH | Adaptive RTH · Opening 60 min · Opening 90 min |
| Confirmation profileconfirmationProfileInput | Choice / text | Structure + volatility context | Structure + volatility context · Selective volatility-confirmed · Structure only |
| PresentationpresentationInput | Choice / text | Phase candles | Phase candles · Map only · Full emphasis |
History and HTF context6 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Retained cycleshistoryCountInput | Whole number | 6 | Min 0 · Max 15 |
| HTF contextcalendarDisplayInput | Choice / text | Panel + ribbon | Panel + ribbon · Panel only · Ribbon only · Off |
| HTF · DailycalendarDailyInput | Toggle | On | Conditional |
| HTF · WeeklycalendarWeeklyInput | Toggle | Off | Conditional |
| HTF · MonthlycalendarMonthlyInput | Toggle | Off | Conditional |
| HTF · QuarterlycalendarQuarterlyInput | Toggle | Off | Conditional |
Status panel2 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Show status panelshowPanelInput | Toggle | On | — |
| Panel positionpanelPositionInput | Choice / text | Top right | Top right · Middle left · Middle center · Middle right · Bottom left · Bottom center · Bottom right | Conditional |
Colors5 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| AccumulationaccumulationColorInput | Color | RGB 59,130,246 | — |
| ManipulationmanipulationColorInput | Color | RGB 245,158,11 | — |
| DistributiondistributionColorInput | Color | RGB 139,92,246 | — |
| UpwardupwardColorInput | Color | RGB 16,185,129 | — |
| DownwarddownwardColorInput | Color | RGB 244,63,94 | — |
Alerts and limitations
What can notify you, what can change the output, and what the indicator cannot establish.
Alerts
Limits to keep visible
- Rule-based chart geometry. The AMD terms label what the rules measured—a contained range, trade beyond its boundary, a move after the reclaim—and establish nothing about participant intent or a future outcome.
- Closed up and closed down describe how a cycle finished. They are statements about bars that have already closed, not a direction for the bars after them.
- A higher-timeframe read is always one completed higher-timeframe bar behind, which is the disclosed consequence of returning only confirmed values on every bar.
- Outside standard 1–15 minute charts on an America/New_York symbol the script abstains. Inside that scope it reads only exchange-designated regular-session bars in the 09:30–16:00 window.
- Adaptive RTH needs 30 eligible windows before it will admit a balance, so a freshly loaded chart draws nothing until the baseline fills.
- Six cycles are retained and older ones are deleted, up to three boxes each against the 60 this script declares. History beyond that is not kept on the chart.
- No alerts, signals, entries, exits, scores, rankings, projections, or performance claims. The script does not tell anyone what to do with what it draws.
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.
The panel says Unsupported chart. What is it checking?
Three things: a standard chart type, a minute timeframe between 1 and 15, and a symbol whose exchange timezone is America/New_York. A 30-minute chart, a Heikin Ashi or Renko chart, or a symbol quoted on another exchange timezone each fail it on their own. The second panel row names the requirement rather than a price or a level.
Why does the panel read Baseline 12/30 with nothing drawn?
Adaptive RTH ranks each candidate window against the 30 most recent eligible windows of the same length, and will not admit a balance from a partial sample. Load more intraday history, or switch to Opening 60 min or Opening 90 min, which take a fixed window from 09:30 and need no baseline.
The cycle ended with No qualifying sweep in 90 min. Did something break?
No. That is the sweep deadline doing its job. A balance that is never left within 90 minutes of completing produces no manipulation phase, and the cycle is named for that rather than waiting indefinitely or picking a side. In Adaptive RTH the next candidate window can still be admitted later the same session.
Why did I get Both range boundaries swept instead of a direction?
Price reached beyond both boundaries of the balance, so no single boundary was the swept one. The geometry has no one-sided reading left to make, and the cycle is closed as unresolved. The boxes stay on the chart with the outcome named, because the alternative would be to round an ambiguous cycle to a side it never earned.
Why are the accumulation bars not recolored with the others?
By design. Under Adaptive RTH the balance range is only known once its candidate bars have closed, so recoloring them would paint a phase onto bars before the script could have known it. Candle coloring begins with the directly observed sweep and post-reclaim bars, which are decided on the bar itself.
One of the higher-timeframe rules is grey, or missing entirely.
Grey is the neutral color an unresolved period takes, so a container that ended ambiguous or closed back on the sweep side reads grey rather than borrowing a phase color. A period with no rule at all has fewer than four completed bars in its current container and therefore no range yet, and a period switched off draws neither its rule nor its name.
The higher-timeframe row disagrees with what the daily chart shows right now.
It is meant to. Every period is requested as a completed-bar tuple offset by one bar, so the read is always one completed higher-timeframe bar behind and identical in replay and in real time. That is the disclosed cost of never showing a value that could still change, and the higher-timeframe read never feeds the intraday detector.
I switched Show status panel off and a panel is still on screen.
That switch hides status, never abstention. On an unsupported chart the panel still draws, because it is the only surface that names the failed condition; hiding it there would leave a blank chart with no explanation. On a supported chart the boxes, the ribbon and the Data Window fields all continue with the panel off.