What this thing does, in plain English
Imagine a stock's price is a rubber band stretched around an invisible middle line. During the day, that middle line is called VWAP — it's what the "average person" paid for the stock so far today. Sometimes price stretches too far up or too far down from the middle. When it does, it usually snaps back.
This indicator watches for that stretch-and-snap. It says:
- "Only trade when the bigger picture agrees." That's the Shannon MA stack — a set of moving averages that has to be stacked like a staircase, either all going up (bullish) or all going down (bearish).
- "Only buy when price is close to the middle line" (VWAP), because that's fair value — you're not chasing.
- "Take profits at the far edges." Once price stretches to 2 standard deviations (2σ) away, it's very likely to snap back. You harvest.
- "Don't be greedy — take profits in pieces." First a 30% chunk at the halfway extreme (1σ), then a 50% chunk at the full extreme (2σ), and let the last 20% ride until the middle line breaks.
- "Don't trade the opening hour." The math needs about 60 minutes of data to know what "far" even means.
That's it. One trade type. Long or short. Same rules mirrored.
Objective
Prove or disprove a single edge: mean-reversion trades entered near VWAP and exited at ±2σ, filtered by Shannon's linear MA alignment, produce positive expectancy (ExpR > 0) with acceptable win rate.
Everything else — the tables, the tooltips, the webhook — is machinery in service of measuring that one edge. If ExpR is positive across ≥ 30 trades on multiple symbols and timeframes, we scale. If not, we go back to the drawing board.
What you see on the chart
The bands (from center out)
| Line / zone | Meaning | Color |
|---|---|---|
| Basis (thick purple) | Session VWAP under 30m; 5-DMA between 30m and daily; 20-DMA on daily+ | Purple |
| ±0.5σ shading | Entry zone. When close is inside this band AND alignment agrees → fire. | Faint gray fill |
| ±1σ line | Tier 1 target (30% off here if aligned in the trade direction) | Blue |
| Fair-value cloud (±1σ) | The "normal range." Price spends most of the session here. | Faint green fill |
| ±2σ line | Tier 2 target (50% off) AND stop (opposite side) | Red |
| Extended zones (+1σ→+2σ, -1σ→-2σ) | Statistically stretched — reversion likely | Faint red fill |
The Shannon MA rainbow
| Line | Role | Color |
|---|---|---|
| SHORT MA | Fastest reference — tells you the immediate trend | Yellow |
| INTERMEDIATE MA | Runner exit trigger (close crosses back through) | Orange |
| LONG MA | Underlying-trend anchor | Red |
| CONFIRMATION MA | Big-picture context (only on some timeframes) | Purple |
Trade markers
- ▲ MR L (green triangle below bar) — entered a long at that close. Hover for full context.
- ▼ MR S (red triangle above bar) — entered a short. Hover for full context.
- Exit label (colored box, same side as entry marker) — trade closed. Green = winner, red = loser, gray = timeout/other. Hover for tier-by-tier attribution.
- Faint green/red tint across bars — a trade is currently OPEN (long = green, short = red).
- ○ small circle (yellow/green/red) — the alignment state just changed. Info marker, not a trade.
The one trade — MR L and MR S
There is exactly one setup class. Long and short are mirrors of each other.
| MR L (long) | MR S (short) | |
|---|---|---|
| Trend gate | Alignment = UP | Alignment = DOWN |
| Entry zone | close ∈ [basis − 0.5σ, basis + 0.5σ] | close ∈ [basis − 0.5σ, basis + 0.5σ] |
| Entry price | close of the qualifying bar | close of the qualifying bar |
| Tier 1 target (30%) | basis + 1σ | basis − 1σ |
| Tier 2 target (50%) | basis + 2σ | basis − 2σ |
| Runner (20%) | close crosses back below INTERMEDIATE MA | close crosses back above INTERMEDIATE MA |
| Stop (all remaining) | basis − 2σ | basis + 2σ |
| Time exit | 26 bars in trade (default) | 26 bars in trade |
Sizing: shares = floor(risk$ / |entry − stop|). Default risk is $100/trade. Whole position taken at entry; the tier structure just controls WHEN pieces come off.
Tiered exits — 30 / 50 / 20
Why partial exits instead of one big target?
- Tier 1 (30% off at ±1σ) — lock in some profit early so a reversal doesn't turn a winner into a loser. If the trade grinds sideways after this, you've already banked a piece.
- Tier 2 (50% off at ±2σ) — the main event. This is where the mean-reversion "extreme" thesis pays out. Between Tier 1 and Tier 2 you've taken 80% of the position, all at profit.
- Runner (20% remaining) — kept alive to capture over-extensions. Exits when close crosses back through the INTERMEDIATE MA (on 30m that's the 17 EMA per Shannon). This is the "let winners run" piece.
How the final R is calculated
Total R = weighted sum of each tier's R at its exit:
R_total = 0.30 × R@T1 + 0.50 × R@T2 + 0.20 × R@runner_exit
(if a tier didn't hit, its portion contributes at the stop or time-exit price)
Example — perfect run: T1 hits (+0.5R at T1), T2 hits (+1.0R at T2), runner exits at +1.5R (INT MA cross above). Total R = 0.30 × 0.5 + 0.50 × 1.0 + 0.20 × 1.5 = 0.15 + 0.50 + 0.30 = +0.95R. Beats a single-exit +1R by nothing much on this run, but the tier structure protected against pull-backs.
Example — stopped after Tier 1: T1 hit (+0.30 × 0.5 = +0.15R banked), then price reversed and hit the stop. Remaining 70% × (−1R) = −0.70R. Total = +0.15 − 0.70 = −0.55R. Compare to a single-exit trade in the same scenario: full stop = −1R. Tier structure reduced the loss by 45%.
Shannon MA framework — auto by chart TF
Brian Shannon's Fig. 10.4 table: different timeframes get different MA lengths. This indicator picks them automatically based on the chart you have open.
| Chart TF | SHORT | INTERMEDIATE | LONG | CONFIRMATION |
|---|---|---|---|---|
| 1 min | 50 | 100 | — | VWAP |
| 2 min | 20 | 50 | 100 | — |
| 5 min | 40 | 100 | 200 | — |
| 10 min | 20 | 50 | 100 | 195 (5 DMA equiv) |
| 30 min | 7 | 17 | 33 | 65 (5 DMA) |
| Daily | 10 | 20 | 50 | 200 |
| Weekly | 10 | 20 | 40 | — |
The "runner exit" always uses the INTERMEDIATE MA — on the 30-minute chart, that's the 17 EMA. On the 2-minute chart, it's 50. On 5-min, 100. Universal rule: the mid-tier MA on whatever chart you're looking at.
If you want to override the auto-selection, uncheck Auto-select MA lengths by chart TF and set the manual values.
Alignment — the linear stack
Shannon's rule for a "clean" trend: every MA is stacked in the right order AND every MA is sloping the right way.
Three modes, easiest to hardest. Default is Loose — a good starting point.
Loose (default)
Just the ORDER has to be right. Think of the MAs like runners in a race: for an UP signal you just need them in the correct finishing order — SHORT ahead of INTERMEDIATE ahead of LONG ahead of CONFIRMATION. Doesn't matter if they're all still accelerating or some are slowing down; if the order is right, alignment is UP. Mirror for DOWN.
Trades fire earlier this way, because the fast MA can flip position before the slow ones have finished turning. More trades, more chances at edge, but also more false starts.
Strict
The toughest mode. Everything Loose requires PLUS every MA has to be sloping the correct direction (rising for UP, falling for DOWN) compared to 3 bars ago.
Like a marching band that has to be in the right lines AND all stepping in sync. Fewest trades. Only the cleanest trends survive. Good for filtering out trend-transition chop.
Rainbow (score-based)
In between. Each of the 4 MAs earns 1 point when TWO things are true at the same time: (a) price is on the correct side of it, AND (b) that MA is sloping the correct direction. Add up the points across 4 MAs — max is 4.
Trade fires when the score is at least N (default 3 of 4). Set N=4 for the same effect as Strict; set N=1 to be super loose. This is the "tuning" mode — for when you know Strict is too tight and Loose is too permissive, and you want to dial in the middle exactly.
NEUTRAL — what happens when nothing lines up
If neither UP nor DOWN conditions are met, alignment is NEUTRAL and no trade fires. Chart shows "NEUTRAL" in the status table's Alignment row.
Warm-up — no signals before 10:30 AM
Default vwapWarmMin = 60 — no signals until 60 minutes into the RTH session (10:30 AM). By that point σ has stabilized enough for the ±1σ / ±2σ bands to represent real edges.
The setting is TF-independent: on 2m that's 30 bars, on 5m it's 12 bars, on 30m it's 2 bars. You get 60 real-clock minutes regardless of resolution.
You can lower or raise this in inputs; a value of 0 turns off warm-up entirely (not recommended for VWAP-basis modes).
Every input, explained
Basis + σ bands
| Input | Default | Purpose |
|---|---|---|
| Basis | Auto (by TF) | Which mean to use. Auto picks session VWAP under 30m, 5-DMA at 30m-<1D, 20-DMA on daily+. |
| VWAP source | ohlc4 | Which price to weight into VWAP. OHLC4 is Shannon's default. |
| Warm-up minutes | 60 | Signal lockout after session open (see §7). |
| Inner mult | 0.5 | Entry-zone half-width in σ. |
| Mid mult | 1.0 | ±1σ band = Tier 1 target. |
| Outer mult | 2.0 | ±2σ band = Tier 2 target AND stop. |
| Show ±0.5σ / ±1σ / ±2σ | all on | Draw those bands on the chart. |
Shannon MA framework
| Input | Default | Purpose |
|---|---|---|
| Auto-select MA by TF | on | Use Fig. 10.4 lookups (recommended). |
| Manual: SHORT / INT / LONG / CONF | 20 / 50 / 100 / 200 | Only used when Auto is off. |
| MA type | EMA | EMA or SMA. EMA more responsive; SMA smoother. |
| Slope lookback | 3 bars | How far back to compare for "is this MA rising?" |
| Plot MAs | on | Draw the rainbow. |
Alignment gate
| Input | Default | Purpose |
|---|---|---|
| Require alignment | on | OFF = MR fires purely on entry-zone hits (no trend filter). |
| Strictness | Strict | See §6 — strict / loose / rainbow. |
| Rainbow: min points | 3 | Threshold when Rainbow mode is picked. |
Trade
| Input | Default | Purpose |
|---|---|---|
| Entry zone (×σ) | 0.5 | Half-width of the entry band around basis. |
| Target (×σ) | 2.0 | Tier 2 (main) target multiplier. |
| Stop (×σ) | 2.0 | Stop = opposite side of basis at this multiplier. |
| Tiered exit | on | OFF reverts to single-exit at target. |
| Tier 1 fraction | 0.30 | % of position taken at Tier 1. |
| Tier 2 fraction | 0.50 | % at Tier 2. Runner = 100 − T1 − T2 (default 20%). |
| Tier 1 target (×σ) | 1.0 | Where Tier 1 partial fires. |
| One position at a time | on | Block new signals while a trade is open. |
| Max bars in trade | 26 | Time-based auto-flat. |
| Cooldown bars | 0 | Bars to wait after an exit before allowing next signal. |
| Streak pause | 0 (off) | Pause direction after N stops. 0 = no pause. |
| Early cover VWAP | off | ON = exit if price crosses back through basis before tiers complete. |
Risk / size
| Input | Default | Purpose |
|---|---|---|
| Risk mode | $ | Fixed dollars or % of account. |
| Risk per trade ($) | 100 | Dollar risk in $-mode. |
| Account $ (for % mode) | 25000 | Base for %-mode sizing. |
| Risk % per trade | 0.5 | %-mode risk. e.g. 25000 × 0.5% = $125 risk. |
| Min / max shares | 1 / 5000 | Sanity caps. |
Display
| Input | Default | Purpose |
|---|---|---|
| Big trade markers | on | Huge labels + faint trade-active tint. |
| Label / table size | Normal / Small | Element sizing. |
| Show status table | on | Top-right diagnostic panel. |
| Show EDGE table | on | Bottom-right per-signal expectancy panel. |
| Detailed tooltips | on | OFF = one-line tooltips instead of expanded. |
Webhook / DB emission
| Input | Default | Purpose |
|---|---|---|
| Send ENTRY/EXIT via alert() | off | Fires TradingView alerts you can wire to a webhook. |
| Log JSON to Pine log | on | Copy-paste from Pine log console for offline analysis. |
| Indicator tag / Engine version | VWAP_FADE / v6.0.0 | Written into every emitted JSON so downstream can filter. |
| Trade ID prefix | VF | Prefix on generated trade IDs. |
Reading the two tables
Status table (top-right)
| Row | What it means |
|---|---|
| VWAP FADE v6.0.0 · session VWAP | Header — which basis type is active. |
| Basis | Current basis price. |
| σ | Current standard deviation (in price units). Small = bands tight. |
| Alignment · UP/DN/NEUTRAL (n/4) | Current MA-stack state and its score. |
| MA lengths | SHORT / INT / LONG / CONF in play for this chart's TF. |
| Entry zone | Low / high bounds of the entry band + IN/out flag. |
| Trade | Current position: LONG @ X / SHORT @ X / flat. |
| Stop / Tgt | Active stop and target when in trade. |
| Risk | $ risk on next / current trade and share count. |
| Streak L / S | Consecutive stopouts per direction. |
| MR L: fire? | ✓ or ✗ (reason). Reason is the FIRST gate blocking, in this order: warmup → align → not in zone → slot → streak. |
| MR S: fire? | Same, for the short side. |
EDGE table (bottom-right)
| Col | Meaning |
|---|---|
| SIGNAL | Setup name (MR L / MR S / ALL / $ TOTAL). |
| N | Trade count. |
| W-L-T | Wins / Losses / Timeouts + breakeven. Classified by R sign (see below). |
| Win% | W / N. |
| TotR | Sum of R over all trades. Green if positive, red if negative. |
| ExpR | The number that matters. TotR / N. Positive with N ≥ 20 = real edge. |
Debug — why isn't it firing?
Look at the MR L: fire? and MR S: fire? rows in the status table. The parenthesized reason is the first blocking gate. Common ones:
| Reason shown | What it means | How to fix (if you want) |
|---|---|---|
warmup | Less than vwapWarmMin minutes into session | Wait, or lower Warm-up minutes (not recommended) |
align (need UP) | MA stack isn't in the required alignment | Try Loose or Rainbow mode, or turn off Require alignment |
not in ±0.5σ zone | Price is outside the entry band right now | Wait for a pullback to VWAP, or widen Entry zone (× σ) |
slot | A trade is already open (one at a time) | Wait for the current trade to exit |
streak | Direction paused after N stops | Wait for a winner, new day, or set Streak pause to 0 |
FAQ
Why is this so different from v5.10?
v5.10 had 11 setup classes (CONT, EXP, VWAP L, PULLBK, BACKSIDE, BASE BRK, and their shorts). Trying to prove edge across 11 setups × dozens of gates = never getting a statistically meaningful sample on any of them. v6.0 collapses to ONE setup class, one thesis, so we can actually measure whether it works. The vaulted v5.10 file is preserved for compare-and-contrast.
Can I still use the σ v5.10 "compression → expansion" trade?
Yes — load the vaulted file: Adaptive_Mean_Std_Dev_Bnads_V5.10-vault-20260919-214304.txt. Runs alongside v6.0 as a separate indicator instance.
Does the runner really wait for the INTERMEDIATE MA cross?
Yes. On a 30-min chart, that's the 17 EMA. On 2m, the 50 EMA. The runner is designed to hold as long as the trend has any legs — MA cross is the definition of "trend is now broken."
What if σ is still too tight after 60 minutes?
Then the trade will fire but the R units will be small. You may want to combine with an ATR floor (not currently implemented in v6.0; roadmap has it as an optional safety belt).
Where do trade events go for grading?
Turn on Send ENTRY/EXIT via alert(), create one TradingView alert on "Any alert() function call" for this indicator, and point the webhook at tradingview_smb_indicator_trigger.php. That writes into alerts_tradingview.indicator_alerts. From there the accountability HUD grading pipeline (Phase 1 in the roadmap) can compare real fills to what the indicator suggested.
How do I know if this actually has edge?
Watch the EDGE table's ExpR column over 30+ trades on multiple symbols and timeframes. Positive ExpR at N ≥ 30 across at least 3 different stocks on 2 different TFs = the edge is real. Anything less is just noise.
Generated 2026-09-19 · v6.0.0 · one thesis, tested honestly.