OPEN-SOURCE SCRIPT
AM TBR - NQ Stats

## Summary
Credit. All historical statistics shown by this indicator are transcribed from the AM TBR study published by NQ Stats — a 10-year analysis of 2,572 NQ sessions (2016–2026). The research design and data analysis are entirely their work; this script is an independent live reconstruction of that methodology
AM TBR anchors a Time-Based Range at the 08:00 New York open, projects ±0.25 standard-deviation levels from that open using a rolling 20-day sample standard deviation of prior session % net changes, and tracks a single, well-defined statistical event in real time: does price touch either level, and if so, does it revert to the TBR Open before 12:00 New York?
Once a touch occurs, the indicator overlays historical context for that exact situation — reversion probability conditional on the hour of the touch, typical adverse excursion (MAE) zones, continuation (MFE) targets after reversion, and time-based cumulative milestones — so you can see at a glance whether the current session is behaving like a typical reverting session or drifting into historically non-reverting territory.
This is a statistical study tool, not a trading system. It does not generate buy/sell signals and makes no claims about future performance.
## What the indicator draws on the chart
At 08:00 New York every weekday the script anchors the TBR Open (drawn as a dashed line extended to 12:00), the two ±0.25σ touch levels, and an optional faint σ ladder at ±0.5 / 0.75 / 1.0 / 1.5 / 2.0 for scale. A light background tint marks the active 08:00–12:00 window.
On the first touch of either level, a marker stamps the exact time (resolved to the minute via lower-timeframe data where available) and shaded MAE zones appear on the touched side. These zones are anchored at the TBR Open — not at the touch level — matching the source study's measurement convention. Reading them from the open outward: the grey zone (TYPICAL) ends at the historical median MAE of sessions that went on to revert; blue (DEEP) ends at the reverted P75; orange (STRETCHED) at the reverted P90; red (RISK) at the median MAE of sessions that never reverted; and the dark zone (NON-REV) extends to the non-reverted P75. The practical reading: while price holds inside grey/blue, the session is taking normal heat for an eventual reversion; pushing through orange into red means the extension now looks more like the historical failures than the historical successes.
If price reverts to the TBR Open before 12:00, the target label flips to REVERTED with the time, and three dotted MFE lines appear on the far side of the open at the historical median (green), P75 (yellow), and P90 (orange) continuation distances — how far past the open reverting sessions historically travelled. At 12:00 the session settles as Reverted, No Reversion, or No Touch.
## Reading the dashboard, row by row
**σ (20d sample).** The rolling standard deviation currently in force, shown both as a percentage and converted to points (e.g. "1.55% ≈ 450.50"). The points figure is your conversion key for every σ value in the table: multiply any σ number by it to get a price distance. A 0.445σ median MAE with σ ≈ 450 points means roughly 200 points of adverse excursion from the open.
**TBR Open (08:00).** The anchor price. Every level, zone, and statistic is measured from here.
**First Touch.** Which level was hit first, the exact time, and the hour band it falls into (08:xx, 09:xx, 10:xx, or 11:xx). The band drives everything below it, because the source study's strongest finding is that reversion odds depend heavily on when the first touch happens.
**Band Reversion Rate.** The historical percentage of sessions with a same-side touch in the same hour band that reverted to the open before 12:00, with its sample size. Colour reflects strength: green at 75%+ (08:xx touches), teal 65–75% (09:xx), orange 45–65%, red below. A ⚠ marks bands where the historical sample is tiny (10:xx and 11:xx, with 48 and 11 touches respectively across ten years) — treat those rates as directional at best.
**Outcome.** The live state machine: Waiting (levels drawn, no touch), Touched — Pending, Reverted ✓ with the reversion time, No Reversion ✗, or No Touch.
**MAE (σ from open).** Your session's maximum adverse extension so far, in σ units measured from the TBR Open, with a context tag comparing it against the reverted-MAE distribution for your band: "≤ p50" means the current heat is smaller than the median reverting session took; "p50–p75" and "p75–p90" mean progressively deeper but still within the range most reverting sessions survived; "> p90 ⚠" means the extension now exceeds nine in ten historical reversions; "≥ non-rev p50 ⚠" means it has reached territory more typical of sessions that never came back. The background shifts green → orange → red accordingly. This row is the single fastest health-check in the table.
## The stat block in depth
The dark header names the exact historical slice being displayed — for example "+0.25 · 08:xx — |σ| FROM TBR OPEN" means every number below describes sessions where +0.25 was touched first during the 08:00 hour, with all distances in σ units from the TBR Open. Signs follow the study's convention: for a +0.25 touch, MAE values print positive (heat is above the open) and MFE prints negative (continuation is below the open); for a −0.25 touch the signs flip.
Each row shows n, Mean, Median, P75, and P90 of a distribution:
**MAE Rev** — adverse excursion of sessions that ultimately reverted. This is the "survivable heat" distribution and the source of the grey/blue/orange zone boundaries. Median well below mean tells you the distribution is right-skewed: most reverting sessions took modest heat, a minority took a lot.
**MAE N-Rev** — maximum extension of sessions that never reverted by 12:00. Compare its median against the MAE-Rev P90: the gap between them is the discrimination region. For 08:xx +0.25 touches, reverting sessions' P90 heat was about 0.96σ while non-reverting sessions' median run was about 1.53σ — extensions between those two values are where the historical populations genuinely separate.
**MFE** — how far beyond the TBR Open reverting sessions continued after reverting. These are the three dotted target lines on the chart. The n here equals the reverted count, since only reverting sessions have an MFE. The large gap between median and P90 (0.69σ vs 1.99σ for 8am +0.25 touches) says continuation is occasionally explosive but usually moderate — which is why the lines are labelled as escalating reference distances rather than a single target.
To convert any cell to points, multiply by the σ-in-points figure from the top of the table.
## The cumulative section
**By 09:00 / 10:00 / 11:00 / 12:00** rows show the source study's cumulative reversion distribution: the percentage of all touched sessions (same side) that had already reverted by that clock time. These figures rise by construction — they are a running total of reversion times, ending at the overall band rate. When your touch is in the 08:xx band, the 8am-focus curve is used (27.9 → 68.2 → 76.1 → 78.4% for +0.25); otherwise the all-sessions curve applies. The Clock column counts down to each checkpoint and to the 12:00 Hard Stop.
Interpreting these correctly matters: a rising cumulative number is not "the odds are improving." The useful live question is conditional — if the session is still pending at a checkpoint, the chance of reverting before 12:00 equals (Final − Cum) ÷ (100 − Cum). Worked from the all-sessions +0.25 curve: still pending at 09:00 leaves roughly a 69% chance of reverting by noon; still pending at 10:00, about 34%; still pending at 11:00, about 10%. The longer a touched session goes without resolving, the more it historically resembles the sessions that never resolved.
## Inputs reference
**Setup group.** *SDEV Lookback* (default 20) sets how many completed daily sessions feed the standard deviation; 20 matches the source study, and changing it moves the levels while decoupling them from the reference statistics. *Touch Level (σ)* (default 0.25) sets the projected level distance — the levels will draw correctly at any value, but all displayed probabilities and distributions were generated for ±0.25 specifically and no longer describe other settings. *TBR Colour* and *Label Size* control appearance. *Keep previous sessions on chart* retains prior sessions' drawings instead of clearing at each new 08:00, useful for visually reviewing recent history (drawings beyond TradingView's object limits are recycled oldest-first).
**Levels group.** *Show σ Ladder* toggles the ±0.5–2.0σ reference lines and *Ladder Colour* styles them. *Show MAE Zones after touch* toggles the shaded zone map; *Zone Labels* independently toggles the text tags on those zones, worth switching off on busy charts. *Show MFE Targets after reversion* toggles the three continuation lines.
**Dashboard group.** *Show Dashboard* toggles the table; *Show Cumulative Milestones* toggles its bottom section if you prefer a shorter table; *Position* and *Text Size* place and scale it.
**Alerts.** Two alert conditions are provided — "Level Touched" and "Reverted to Open." Create them from the standard alert dialog by selecting this indicator and the desired condition; "Once Per Bar" is the natural frequency for both.
## How the statistics were generated (methodology and source)
The probabilities and distribution values displayed by this indicator are **not computed from your chart**. They are transcribed reference statistics from an independently published, publicly available 10-year statistical study of NASDAQ-100 E-mini futures (NQ) covering 2016–2026 (published by NQ Stats). That study's methodology, which this indicator reproduces live:
- **2,572 total sessions** analysed; **2,545 touched** a ±0.25σ level within the window (1,252 touched +0.25 first, 1,293 touched −0.25 first).
- **σ definition:** rolling 20-day *sample* standard deviation of prior session % net changes; the level is projected as TBR Open × (1 ± 0.25 × σ/100).
- **Window:** 08:00–12:00 New York time; a session "reverts" if price returns to the TBR Open after the touch and before 12:00.
- **Headline rates:** 74.0% of +0.25 touches and 74.6% of −0.25 touches reverted, strongly conditional on touch hour: roughly 79% for 08:xx, 69.5% for 09:xx, 39.6% for 10:xx, 9.1% for 11:xx.
- **MAE and MFE** are measured in |σ| units from the TBR Open. Where the study published no distribution rows for a band (MFE for 10/11:xx touches; MAE for 11:xx), the nearest earlier band's values are substituted and documented in the code.
**What is computed live from your chart:** the σ value, the TBR Open, all level and zone prices, touch and reversion detection and timing, and the running MAE. The geometry is yours; the probabilities are the study's, projected onto your chart's coordinates.
## Detection details
On chart timeframes of 1 minute and above, 1-minute intrabar data timestamps the first touch to the exact minute and sequences same-bar events correctly, so a pre-touch dip to the open is never miscounted as a reversion. Where 1-minute history is unavailable (deep chart history), detection falls back to chart-bar resolution with a documented tiebreak. Reversion means trading at or through the TBR Open price.
## Recommended use
NQ / MNQ futures (the reference statistics are NQ-specific; other symbols will run but the statistics will not apply), on 1–15 minute timeframes that divide evenly into an hour so the 08:00 anchor aligns exactly. The most robust historical context comes from 08:xx touches (n ≈ 1,500); late-morning touches carry small samples and wide uncertainty.
## Limitations and honest caveats
Historical frequencies are not probabilities of future outcomes; regimes drift. The live σ may differ slightly from the study's around continuous-contract roll dates, since roll adjustments perturb close-to-close % changes — statistics are σ-relative so behavioural context transfers, but exact prices may differ marginally from the original research. Sub-minute event ordering is unknowable at any bar resolution, and MAE on the reversion bar can be slightly overstated when the adverse extreme printed after the open-cross within the same bar; the underlying 1-minute study shares the same granularity limits. Source values were transcribed from the published tables and not independently re-derived; one internal inconsistency in the source (a single P90 cell differing between two of its tables) is documented in the code with the more internally consistent value chosen.
This indicator is for educational and analytical purposes only and is not financial advice.
---
*Open-source under the Mozilla Public License 2.0. The statistical reference values are transcribed from publicly published research as described above; the live reconstruction, detection engine, and visualisation are original work.*
Credit. All historical statistics shown by this indicator are transcribed from the AM TBR study published by NQ Stats — a 10-year analysis of 2,572 NQ sessions (2016–2026). The research design and data analysis are entirely their work; this script is an independent live reconstruction of that methodology
AM TBR anchors a Time-Based Range at the 08:00 New York open, projects ±0.25 standard-deviation levels from that open using a rolling 20-day sample standard deviation of prior session % net changes, and tracks a single, well-defined statistical event in real time: does price touch either level, and if so, does it revert to the TBR Open before 12:00 New York?
Once a touch occurs, the indicator overlays historical context for that exact situation — reversion probability conditional on the hour of the touch, typical adverse excursion (MAE) zones, continuation (MFE) targets after reversion, and time-based cumulative milestones — so you can see at a glance whether the current session is behaving like a typical reverting session or drifting into historically non-reverting territory.
This is a statistical study tool, not a trading system. It does not generate buy/sell signals and makes no claims about future performance.
## What the indicator draws on the chart
At 08:00 New York every weekday the script anchors the TBR Open (drawn as a dashed line extended to 12:00), the two ±0.25σ touch levels, and an optional faint σ ladder at ±0.5 / 0.75 / 1.0 / 1.5 / 2.0 for scale. A light background tint marks the active 08:00–12:00 window.
On the first touch of either level, a marker stamps the exact time (resolved to the minute via lower-timeframe data where available) and shaded MAE zones appear on the touched side. These zones are anchored at the TBR Open — not at the touch level — matching the source study's measurement convention. Reading them from the open outward: the grey zone (TYPICAL) ends at the historical median MAE of sessions that went on to revert; blue (DEEP) ends at the reverted P75; orange (STRETCHED) at the reverted P90; red (RISK) at the median MAE of sessions that never reverted; and the dark zone (NON-REV) extends to the non-reverted P75. The practical reading: while price holds inside grey/blue, the session is taking normal heat for an eventual reversion; pushing through orange into red means the extension now looks more like the historical failures than the historical successes.
If price reverts to the TBR Open before 12:00, the target label flips to REVERTED with the time, and three dotted MFE lines appear on the far side of the open at the historical median (green), P75 (yellow), and P90 (orange) continuation distances — how far past the open reverting sessions historically travelled. At 12:00 the session settles as Reverted, No Reversion, or No Touch.
## Reading the dashboard, row by row
**σ (20d sample).** The rolling standard deviation currently in force, shown both as a percentage and converted to points (e.g. "1.55% ≈ 450.50"). The points figure is your conversion key for every σ value in the table: multiply any σ number by it to get a price distance. A 0.445σ median MAE with σ ≈ 450 points means roughly 200 points of adverse excursion from the open.
**TBR Open (08:00).** The anchor price. Every level, zone, and statistic is measured from here.
**First Touch.** Which level was hit first, the exact time, and the hour band it falls into (08:xx, 09:xx, 10:xx, or 11:xx). The band drives everything below it, because the source study's strongest finding is that reversion odds depend heavily on when the first touch happens.
**Band Reversion Rate.** The historical percentage of sessions with a same-side touch in the same hour band that reverted to the open before 12:00, with its sample size. Colour reflects strength: green at 75%+ (08:xx touches), teal 65–75% (09:xx), orange 45–65%, red below. A ⚠ marks bands where the historical sample is tiny (10:xx and 11:xx, with 48 and 11 touches respectively across ten years) — treat those rates as directional at best.
**Outcome.** The live state machine: Waiting (levels drawn, no touch), Touched — Pending, Reverted ✓ with the reversion time, No Reversion ✗, or No Touch.
**MAE (σ from open).** Your session's maximum adverse extension so far, in σ units measured from the TBR Open, with a context tag comparing it against the reverted-MAE distribution for your band: "≤ p50" means the current heat is smaller than the median reverting session took; "p50–p75" and "p75–p90" mean progressively deeper but still within the range most reverting sessions survived; "> p90 ⚠" means the extension now exceeds nine in ten historical reversions; "≥ non-rev p50 ⚠" means it has reached territory more typical of sessions that never came back. The background shifts green → orange → red accordingly. This row is the single fastest health-check in the table.
## The stat block in depth
The dark header names the exact historical slice being displayed — for example "+0.25 · 08:xx — |σ| FROM TBR OPEN" means every number below describes sessions where +0.25 was touched first during the 08:00 hour, with all distances in σ units from the TBR Open. Signs follow the study's convention: for a +0.25 touch, MAE values print positive (heat is above the open) and MFE prints negative (continuation is below the open); for a −0.25 touch the signs flip.
Each row shows n, Mean, Median, P75, and P90 of a distribution:
**MAE Rev** — adverse excursion of sessions that ultimately reverted. This is the "survivable heat" distribution and the source of the grey/blue/orange zone boundaries. Median well below mean tells you the distribution is right-skewed: most reverting sessions took modest heat, a minority took a lot.
**MAE N-Rev** — maximum extension of sessions that never reverted by 12:00. Compare its median against the MAE-Rev P90: the gap between them is the discrimination region. For 08:xx +0.25 touches, reverting sessions' P90 heat was about 0.96σ while non-reverting sessions' median run was about 1.53σ — extensions between those two values are where the historical populations genuinely separate.
**MFE** — how far beyond the TBR Open reverting sessions continued after reverting. These are the three dotted target lines on the chart. The n here equals the reverted count, since only reverting sessions have an MFE. The large gap between median and P90 (0.69σ vs 1.99σ for 8am +0.25 touches) says continuation is occasionally explosive but usually moderate — which is why the lines are labelled as escalating reference distances rather than a single target.
To convert any cell to points, multiply by the σ-in-points figure from the top of the table.
## The cumulative section
**By 09:00 / 10:00 / 11:00 / 12:00** rows show the source study's cumulative reversion distribution: the percentage of all touched sessions (same side) that had already reverted by that clock time. These figures rise by construction — they are a running total of reversion times, ending at the overall band rate. When your touch is in the 08:xx band, the 8am-focus curve is used (27.9 → 68.2 → 76.1 → 78.4% for +0.25); otherwise the all-sessions curve applies. The Clock column counts down to each checkpoint and to the 12:00 Hard Stop.
Interpreting these correctly matters: a rising cumulative number is not "the odds are improving." The useful live question is conditional — if the session is still pending at a checkpoint, the chance of reverting before 12:00 equals (Final − Cum) ÷ (100 − Cum). Worked from the all-sessions +0.25 curve: still pending at 09:00 leaves roughly a 69% chance of reverting by noon; still pending at 10:00, about 34%; still pending at 11:00, about 10%. The longer a touched session goes without resolving, the more it historically resembles the sessions that never resolved.
## Inputs reference
**Setup group.** *SDEV Lookback* (default 20) sets how many completed daily sessions feed the standard deviation; 20 matches the source study, and changing it moves the levels while decoupling them from the reference statistics. *Touch Level (σ)* (default 0.25) sets the projected level distance — the levels will draw correctly at any value, but all displayed probabilities and distributions were generated for ±0.25 specifically and no longer describe other settings. *TBR Colour* and *Label Size* control appearance. *Keep previous sessions on chart* retains prior sessions' drawings instead of clearing at each new 08:00, useful for visually reviewing recent history (drawings beyond TradingView's object limits are recycled oldest-first).
**Levels group.** *Show σ Ladder* toggles the ±0.5–2.0σ reference lines and *Ladder Colour* styles them. *Show MAE Zones after touch* toggles the shaded zone map; *Zone Labels* independently toggles the text tags on those zones, worth switching off on busy charts. *Show MFE Targets after reversion* toggles the three continuation lines.
**Dashboard group.** *Show Dashboard* toggles the table; *Show Cumulative Milestones* toggles its bottom section if you prefer a shorter table; *Position* and *Text Size* place and scale it.
**Alerts.** Two alert conditions are provided — "Level Touched" and "Reverted to Open." Create them from the standard alert dialog by selecting this indicator and the desired condition; "Once Per Bar" is the natural frequency for both.
## How the statistics were generated (methodology and source)
The probabilities and distribution values displayed by this indicator are **not computed from your chart**. They are transcribed reference statistics from an independently published, publicly available 10-year statistical study of NASDAQ-100 E-mini futures (NQ) covering 2016–2026 (published by NQ Stats). That study's methodology, which this indicator reproduces live:
- **2,572 total sessions** analysed; **2,545 touched** a ±0.25σ level within the window (1,252 touched +0.25 first, 1,293 touched −0.25 first).
- **σ definition:** rolling 20-day *sample* standard deviation of prior session % net changes; the level is projected as TBR Open × (1 ± 0.25 × σ/100).
- **Window:** 08:00–12:00 New York time; a session "reverts" if price returns to the TBR Open after the touch and before 12:00.
- **Headline rates:** 74.0% of +0.25 touches and 74.6% of −0.25 touches reverted, strongly conditional on touch hour: roughly 79% for 08:xx, 69.5% for 09:xx, 39.6% for 10:xx, 9.1% for 11:xx.
- **MAE and MFE** are measured in |σ| units from the TBR Open. Where the study published no distribution rows for a band (MFE for 10/11:xx touches; MAE for 11:xx), the nearest earlier band's values are substituted and documented in the code.
**What is computed live from your chart:** the σ value, the TBR Open, all level and zone prices, touch and reversion detection and timing, and the running MAE. The geometry is yours; the probabilities are the study's, projected onto your chart's coordinates.
## Detection details
On chart timeframes of 1 minute and above, 1-minute intrabar data timestamps the first touch to the exact minute and sequences same-bar events correctly, so a pre-touch dip to the open is never miscounted as a reversion. Where 1-minute history is unavailable (deep chart history), detection falls back to chart-bar resolution with a documented tiebreak. Reversion means trading at or through the TBR Open price.
## Recommended use
NQ / MNQ futures (the reference statistics are NQ-specific; other symbols will run but the statistics will not apply), on 1–15 minute timeframes that divide evenly into an hour so the 08:00 anchor aligns exactly. The most robust historical context comes from 08:xx touches (n ≈ 1,500); late-morning touches carry small samples and wide uncertainty.
## Limitations and honest caveats
Historical frequencies are not probabilities of future outcomes; regimes drift. The live σ may differ slightly from the study's around continuous-contract roll dates, since roll adjustments perturb close-to-close % changes — statistics are σ-relative so behavioural context transfers, but exact prices may differ marginally from the original research. Sub-minute event ordering is unknowable at any bar resolution, and MAE on the reversion bar can be slightly overstated when the adverse extreme printed after the open-cross within the same bar; the underlying 1-minute study shares the same granularity limits. Source values were transcribed from the published tables and not independently re-derived; one internal inconsistency in the source (a single P90 cell differing between two of its tables) is documented in the code with the more internally consistent value chosen.
This indicator is for educational and analytical purposes only and is not financial advice.
---
*Open-source under the Mozilla Public License 2.0. The statistical reference values are transcribed from publicly published research as described above; the live reconstruction, detection engine, and visualisation are original work.*
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.