OPEN-SOURCE SCRIPT
Acceptance-Retest indicator

# Acceptance-Retest Dashboard
**Companion to the Sweep-Reclaim Dashboard.** Same four levels, same session logic, opposite
read on price behavior — this one tracks what happens when a level *doesn't* reject.
---
## What this script does
Most level-based tools only handle one outcome: price hits a level and reverses. But price at
a key level only ever does one of three things — **rejects, accepts, or chops** — and a
rejection-only tool is blind to two-thirds of that.
This script tracks the **acceptance** case: a level breaks, price *holds* beyond it instead of
snapping back, and a genuine continuation trade sets up on the retest or base that follows.
It automatically:
- Plots **PDH / PDL / ONH / ONL** — prior-day high/low and overnight high/low
- Detects a real breakout close (not just a wick) beyond any of the four levels
- Confirms the level actually held before treating it as a trade candidate
- Waits for a retest or a tight base to form, then triggers on the break of that structure
- Computes entry, stop, target and R:R automatically — no manual level math
- Tracks the trade live once triggered — active, target hit, stopped, or timed out — so you
always know whether the last signal is still good
- Fires a TradingView alert the moment a valid setup completes
Every signal on the chart is prefixed **`AR:`** so it's never confused with a rejection-style
signal from a different tool running on the same chart.
---
## The rule book — Acceptance-Retest methodology
### The core idea
At any key level, price does one of three things:
| Behavior | Candle signature | What it means |
|---|---|---|
| **Rejection** | Wick through, closes back inside | Liquidity grab — level held |
| **Acceptance** | Real body close beyond, price holds | Level flipped — trade the hold |
| **Chop** | Repeated wicks and closes both sides | No edge — stand aside |
This script exists for the middle row. If you're already running a rejection/sweep-style
system, this is built to sit alongside it, not replace it — they read the *same* event and
reach opposite, mutually exclusive conclusions from it.
### The sequence, step by step
**1. Breakout.** Price trades through one of the four levels.
**2. Close confirmation.** A candle **closes** beyond the level — a real body close, not a
wick poking through. No close beyond → not this setup.
**3. No-reclaim check.** The next couple of candles must **not** close back on the original
side. If price reclaims within that window, this was a rejection, not an acceptance — a
different setup entirely, and this script drops it.
**4. Hold — retest or base.** Once the no-reclaim check passes, price needs to show one of two
structures before an entry is considered:
- **Retest:** a pullback toward the level that holds and turns, forming a higher low
(bullish) or lower high (bearish).
- **Base:** a tight, low-overlap sideways range instead of a pullback — still evidence the
level is holding, just without giving a clean retest.
If neither forms within a reasonable window, the attempt expires. Extended, un-based moves are
not entries — they're skips.
**5. Entry.** The break of the retest high/low, or the break of the base range.
**6. Stop.** Beyond the retest or base structure point — never an arbitrary distance, and
capped relative to that level's typical range so a single trade can't take on outsized risk
just because the structural point happened to be far away.
**7. Target.** A measured-move projection from the breakout level, pulled in to the nearer
opposing level when one exists inside that projection.
**8. Filter.** Minimum reward-to-risk gate — trades that don't clear it are skipped, not taken
anyway at reduced size.
### What invalidates a setup after it's already tracking
- **A reclose back through the level** during the hold phase — the move never actually held.
- **No retest or base within the watch window** — extended without structure.
- **Stop distance beyond the risk cap** — the structural stop doesn't fit, so the trade is
skipped rather than resized to fit.
- **Outside the trading window** — signals outside the configured session are not taken.
### Managing an active signal
Every valid trigger is tracked automatically against three outcomes, all defined *before*
entry, never adjusted mid-trade:
1. **Target hit** — the projected level is reached.
2. **Stop hit** — price trades back through the structural stop.
3. **Time stop** — not resolved by a configured cutoff time, closed out regardless of where
price is at that moment. A trade that hasn't reached target isn't a trade still "working" —
it's a trade that should be closed and logged honestly.
A trade that runs *past* target after a time stop already closed it doesn't get to become a
retroactive winner. The discipline is the point — not squeezing the best possible outcome out
of hindsight.
---
## Dashboard guide
**Level rows (PDH / PDL / ONH / ONL):**
- **Price** — the level's current value
- **Stage** — idle, no-reclaim check, or watching for retest/base
- **Bars** — how long the current stage has been running
- **Last signal** — the most recent outcome for that level: a full trade, or a specific skip
reason (reclaimed, expired, stop beyond cap, R:R too low)
**Active trade row:**
- The single most recent valid signal, with entry / stop / target
- **Status** — ACTIVE, TARGET HIT, STOPPED, or EXPIRED, updated live every bar
A level clustered too close to another active level is marked accordingly and excluded from
detection until it separates — this prevents two overlapping levels from generating
contradictory signals at effectively the same price.
---
## Settings
- **Sessions** — must match your other level-based indicators exactly, or the four levels will
disagree across scripts on the same chart.
- **Planning** — ATR length, minimum R:R, and the stop-risk cap (scaled to both the level's
typical range and current volatility, so a calm prior session doesn't choke off signals on a
day that's actually moving hard).
- **Acceptance rules** — how many bars must pass without a reclaim, how long to wait for a
retest/base before giving up, and how tight a base range needs to be to count.
- **Trading windows** — the session(s) during which new signals are allowed to trigger.
- **Time stop** — the cutoff time for closing anything still open.
- **Display** — dashboard position, text size, and whether to draw the level lines and active
trade markers on the chart.
---
## Notes
- This script draws its own copy of PDH/PDL/ONH/ONL so it works standalone; running it
alongside a companion rejection-style script on the same chart is fully supported — the
level math is identical, so both agree on where the four levels sit.
- Designed for 5-minute charts on index futures and related instruments; behavior on other
timeframes or asset classes has not been validated.
- A single active-trade slot is tracked at a time. A new valid signal replaces the previous
one rather than stacking multiple simultaneous trades.
---
## Disclaimer
This script is a **decision-support and rule-automation tool**, not a signal service or
trading advice. It mechanizes a specific discretionary methodology — it does not predict
price, guarantee outcomes, or account for news, liquidity conditions, or market regime shifts.
Past behavior of any setup shown here is not indicative of future results. All trading
decisions, position sizing, and risk management remain the sole responsibility of the user.
Backtest and forward-test thoroughly before applying any setup with real capital.
**Companion to the Sweep-Reclaim Dashboard.** Same four levels, same session logic, opposite
read on price behavior — this one tracks what happens when a level *doesn't* reject.
---
## What this script does
Most level-based tools only handle one outcome: price hits a level and reverses. But price at
a key level only ever does one of three things — **rejects, accepts, or chops** — and a
rejection-only tool is blind to two-thirds of that.
This script tracks the **acceptance** case: a level breaks, price *holds* beyond it instead of
snapping back, and a genuine continuation trade sets up on the retest or base that follows.
It automatically:
- Plots **PDH / PDL / ONH / ONL** — prior-day high/low and overnight high/low
- Detects a real breakout close (not just a wick) beyond any of the four levels
- Confirms the level actually held before treating it as a trade candidate
- Waits for a retest or a tight base to form, then triggers on the break of that structure
- Computes entry, stop, target and R:R automatically — no manual level math
- Tracks the trade live once triggered — active, target hit, stopped, or timed out — so you
always know whether the last signal is still good
- Fires a TradingView alert the moment a valid setup completes
Every signal on the chart is prefixed **`AR:`** so it's never confused with a rejection-style
signal from a different tool running on the same chart.
---
## The rule book — Acceptance-Retest methodology
### The core idea
At any key level, price does one of three things:
| Behavior | Candle signature | What it means |
|---|---|---|
| **Rejection** | Wick through, closes back inside | Liquidity grab — level held |
| **Acceptance** | Real body close beyond, price holds | Level flipped — trade the hold |
| **Chop** | Repeated wicks and closes both sides | No edge — stand aside |
This script exists for the middle row. If you're already running a rejection/sweep-style
system, this is built to sit alongside it, not replace it — they read the *same* event and
reach opposite, mutually exclusive conclusions from it.
### The sequence, step by step
**1. Breakout.** Price trades through one of the four levels.
**2. Close confirmation.** A candle **closes** beyond the level — a real body close, not a
wick poking through. No close beyond → not this setup.
**3. No-reclaim check.** The next couple of candles must **not** close back on the original
side. If price reclaims within that window, this was a rejection, not an acceptance — a
different setup entirely, and this script drops it.
**4. Hold — retest or base.** Once the no-reclaim check passes, price needs to show one of two
structures before an entry is considered:
- **Retest:** a pullback toward the level that holds and turns, forming a higher low
(bullish) or lower high (bearish).
- **Base:** a tight, low-overlap sideways range instead of a pullback — still evidence the
level is holding, just without giving a clean retest.
If neither forms within a reasonable window, the attempt expires. Extended, un-based moves are
not entries — they're skips.
**5. Entry.** The break of the retest high/low, or the break of the base range.
**6. Stop.** Beyond the retest or base structure point — never an arbitrary distance, and
capped relative to that level's typical range so a single trade can't take on outsized risk
just because the structural point happened to be far away.
**7. Target.** A measured-move projection from the breakout level, pulled in to the nearer
opposing level when one exists inside that projection.
**8. Filter.** Minimum reward-to-risk gate — trades that don't clear it are skipped, not taken
anyway at reduced size.
### What invalidates a setup after it's already tracking
- **A reclose back through the level** during the hold phase — the move never actually held.
- **No retest or base within the watch window** — extended without structure.
- **Stop distance beyond the risk cap** — the structural stop doesn't fit, so the trade is
skipped rather than resized to fit.
- **Outside the trading window** — signals outside the configured session are not taken.
### Managing an active signal
Every valid trigger is tracked automatically against three outcomes, all defined *before*
entry, never adjusted mid-trade:
1. **Target hit** — the projected level is reached.
2. **Stop hit** — price trades back through the structural stop.
3. **Time stop** — not resolved by a configured cutoff time, closed out regardless of where
price is at that moment. A trade that hasn't reached target isn't a trade still "working" —
it's a trade that should be closed and logged honestly.
A trade that runs *past* target after a time stop already closed it doesn't get to become a
retroactive winner. The discipline is the point — not squeezing the best possible outcome out
of hindsight.
---
## Dashboard guide
**Level rows (PDH / PDL / ONH / ONL):**
- **Price** — the level's current value
- **Stage** — idle, no-reclaim check, or watching for retest/base
- **Bars** — how long the current stage has been running
- **Last signal** — the most recent outcome for that level: a full trade, or a specific skip
reason (reclaimed, expired, stop beyond cap, R:R too low)
**Active trade row:**
- The single most recent valid signal, with entry / stop / target
- **Status** — ACTIVE, TARGET HIT, STOPPED, or EXPIRED, updated live every bar
A level clustered too close to another active level is marked accordingly and excluded from
detection until it separates — this prevents two overlapping levels from generating
contradictory signals at effectively the same price.
---
## Settings
- **Sessions** — must match your other level-based indicators exactly, or the four levels will
disagree across scripts on the same chart.
- **Planning** — ATR length, minimum R:R, and the stop-risk cap (scaled to both the level's
typical range and current volatility, so a calm prior session doesn't choke off signals on a
day that's actually moving hard).
- **Acceptance rules** — how many bars must pass without a reclaim, how long to wait for a
retest/base before giving up, and how tight a base range needs to be to count.
- **Trading windows** — the session(s) during which new signals are allowed to trigger.
- **Time stop** — the cutoff time for closing anything still open.
- **Display** — dashboard position, text size, and whether to draw the level lines and active
trade markers on the chart.
---
## Notes
- This script draws its own copy of PDH/PDL/ONH/ONL so it works standalone; running it
alongside a companion rejection-style script on the same chart is fully supported — the
level math is identical, so both agree on where the four levels sit.
- Designed for 5-minute charts on index futures and related instruments; behavior on other
timeframes or asset classes has not been validated.
- A single active-trade slot is tracked at a time. A new valid signal replaces the previous
one rather than stacking multiple simultaneous trades.
---
## Disclaimer
This script is a **decision-support and rule-automation tool**, not a signal service or
trading advice. It mechanizes a specific discretionary methodology — it does not predict
price, guarantee outcomes, or account for news, liquidity conditions, or market regime shifts.
Past behavior of any setup shown here is not indicative of future results. All trading
decisions, position sizing, and risk management remain the sole responsibility of the user.
Backtest and forward-test thoroughly before applying any setup with real capital.
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.