OTE Sweep Signal + MTF Bias + VWAP + DR# OTE Sweep Signal + MTF Bias + VWAP + DR
## Overview
A comprehensive intraday trading system that combines four core concepts into one indicator: **Dealing Range (DR) session boxes**, **Optimal Trade Entry (OTE) sweep signals**, **Multi-Timeframe (MTF) bias**, and **VWAP**. Designed for futures traders (NQ, MNQ, ES, MES) but works on any liquid intraday instrument.
The indicator automatically identifies when price sweeps liquidity above or below a prior HTF candle's high or low, pulls back into the 50–61.8% retracement zone (the OTE), and fires an entry signal — all filtered by session time, swing structure, range limits, VWAP, and a confirmed Dealing Range bias.
---
## How It Works
### 1. HTF Sweep Detection
On each new bar of your chosen Signal Timeframe (default 60m), the indicator locks in the prior candle's high and low as liquidity targets. If price sweeps above the prior high without taking the prior low (bull sweep), or below the prior low without taking the prior high (bear sweep), the sweep is locked in and the OTE zone is drawn.
### 2. OTE Zone
Once a sweep is detected, the indicator calculates the retracement zone between the 50% and your chosen OTE level (default 61.8%) of the swept candle's range. When price closes back inside this zone for the first time, an entry signal fires.
### 3. Entry, Stop, BE, and Target
- **Entry**: Top of OTE zone (bull) or bottom (bear)
- **Stop**: Prior candle high/low OR OTE zone buffer (selectable)
- **Break Even (BE)**: HTF candle open price
- **Target**: Prior candle H/L, next HTF swing H/L, or a fixed R:R multiplier
Each signal draws a label showing all four levels.
---
## Settings Groups
### Timeframe
- **Signal Timeframe** — The HTF used to identify sweeps and draw the OTE zone. Default 60m. Works on any intraday TF (5m, 15m, 30m, 60m, 240m).
- **Auto Sweep Window** — Automatically sets the window for valid sweeps to 1/3 of the signal TF duration. Turn off to set manually.
- **Sweep Window (minutes)** — Manual sweep window when Auto is off.
---
### OTE Zone
- **OTE Level (%)** — The deep retracement level that defines the bottom of the OTE zone. Default 61.8%. Range: 55–79%.
- **Show OTE Zone** — Toggle the shaded OTE box on/off.
- **Show Key Levels** — Toggle individual level lines (prior H/L, open, stop, target).
---
### Signals
- **Show Entry Arrows** — LONG/SHORT arrows plotted at the signal bar.
- **Show Stop & Target Label** — Detailed label with Entry, Stop, BE, and Target levels.
- **Stop Method** — *Prior Candle High/Low*: stop at the swept candle's opposite extreme. *OTE Zone Buffer*: stop just beyond the OTE deep level by a % of range.
- **OTE Stop Buffer** — Buffer percentage when using OTE Zone Buffer stop method.
- **Max Prior Candle Range (pts)** — Filters out signals where the swept candle's range is too large to produce a clean OTE setup. Default 100 pts.
- **Enable Max Range Filter** — Toggle the range filter on/off.
- **Target Method** — *Prior Candle H/L*: target the opposite extreme of the swept candle. *Next Swing H/L*: target the nearest HTF swing high/low beyond the sweep. *Fixed R:R*: target = entry ± (risk × multiplier).
- **Fixed R:R Multiplier** — Used only when Target Method is Fixed R:R. 2.0 = 2:1 reward to risk.
---
### Swing Filter
Filters out signals where price has swept through an intermediate HTF swing high or low between the prior candle extreme and the current bar. This prevents chasing signals that are actually breaking through multi-bar structure, not just taking a liquidity sweep.
- **Enable Swing Filter** — Toggle on/off.
- **Show Swing Levels** — Plots the four most recent HTF swing highs and lows as reference lines.
- **Show Blocked Signals** — Shows faded X arrows where a signal was detected but blocked by the swing filter or range filter.
---
### Session Filter
- **Enable Session Filter** — Only fire OTE signals during your defined trading hours.
- **Session Start Hour (ET)** — Default 9 (9 AM ET).
- **Session End Hour (ET)** — Default 16 (4 PM ET).
---
### Dealing Range (DR)
The Dealing Range (also called the Initial Balance) is the high/low established during each session's opening window. Three sessions are tracked independently.
**Session Times (all ET):**
| Session | Build Window | Extend Window |
|---|---|---|
| Asia | 7:00 PM – 8:00 PM | 8:00 PM – 2:00 AM |
| London | 3:00 AM – 4:00 AM | 4:00 AM – 8:30 AM |
| New York | 9:30 AM – 10:30 AM | 10:30 AM – 4:00 PM |
**Display options:**
- **Show Asia / London / New York DR** — Toggle each session independently.
- **DR Time / Extend** — Fully customizable session windows for each.
- **Show DR Box (build window only)** — Shaded box that spans only the DR build period. Updates live as price builds the range and freezes when the session ends.
- **Show DR High/Low Lines** — Horizontal lines at the DR high and low. Can extend into the session extend window.
- **Extend H/L Lines into session** — When on, H/L lines extend to the end of the session extend window.
- **Show DR Open Line** — Dashed line at the first price of the DR session.
- **Show 25 / 50 / 75% Levels** — Internal DR levels at 25%, 50%, and 75% of the DR range. Update live during the build window and freeze when the DR closes. Labeled at the right edge.
- **Extend % Lines into session** — When on, the 25/50/75% lines also extend into the extend window.
- **Show % Level Labels** — Small text labels at the right edge of each % line.
- **Line Width** — Width of all DR lines (1–4 px).
**Per-session colors:** Each session (Asia, London, NY) has three separate color pickers — Box fill, High/Low line, and % lines — so you can distinguish sessions at a glance.
**DR Open Line Color** — Shared color for the open line across all sessions.
**NY DR Break + Day Bias Filter:**
Once the NY DR build window closes (10:30 AM), the indicator watches for price to close outside the NY DR high or low. When confirmed, it locks in the day's directional bias and fires a labeled arrow on the chart.
- **Filter OTE by NY DR Break Direction** — When on, only takes OTE longs when day bias is BULL, only takes OTE shorts when day bias is BEAR.
- **Show DR Break Label on Chart** — Arrow label showing "BULL DR" or "BEAR DR" with timestamp at the confirmation bar.
- **Confirmation Closes Required** — Number of consecutive closes beyond the DR high/low needed to confirm (1–3). Default 1.
- **Enable Time Gate** — Prevents the DR bias filter from activating before a set time. Avoids pre-market fakeouts locking you into one direction all day. Default 10:30 AM ET.
- **Gate Hour / Gate Minute** — The time gate threshold.
- **Block All Signals Before Gate Time** — When on, no OTE signals fire at all until the gate time passes.
- **Break Bull / Bear Color** — Colors for the DR break label and bias display.
---
### VWAP
- **Show VWAP Line** — Plots the session VWAP. Color and width adjustable.
- **Enable VWAP Filter** — When on, only takes long OTE signals when price is above VWAP, and short signals when below. Defaults to OFF — use the Results Table to A/B test its effect.
- **Show VWAP Distance in Bias Table** — Adds a row to the MTF Bias Table showing how many points price is currently above or below VWAP.
---
### HTF Range Box
Draws a shaded box for every bar of your Signal Timeframe, spanning the full high-to-low range. The box updates live as the HTF candle builds and the color reflects the current candle's direction (green if close ≥ open, red if not). These boxes give immediate visual context for where the HTF candle is relative to its own range.
- **Show HTF Range Box** — Toggle on/off.
- **Bull / Bear Fill Color** — Box fill colors for bullish and bearish HTF candles.
- **Bull / Bear Border Color** — Border colors.
- **Border Width** — 0–4 px.
- **Extend Current Box Right** — When on, the active box projects one bar to the right.
---
### MTF Bias Table
A live bias dashboard showing whether each of your seven chosen timeframes is currently Bullish, Bearish, or Neutral — based on whether the current bar has broken above the prior bar's high or below the prior bar's low.
- **Show MTF Bias Table** — Toggle on/off.
- **TF 1–7** — Set any seven timeframes to monitor. Defaults: 1, 5, 15, 30, 60, 240, D.
- **Bias Table Position** — Top Right, Top Left, Bottom Right, Bottom Left.
- **Bias Table Size** — Tiny, Small, Normal, Large.
- **Show Bull/Bear Score Row** — Summary row showing count of bullish vs bearish TFs (e.g. "4B / 3S").
- **Show Accuracy (n / %)** — For each TF, tracks how often the bias signal correctly predicted the following bar's close direction. Shows percentage and sample count. Each TF accumulates at its own rate — a 1m TF will have far more samples than a Daily.
- **All color options** — Separate colors for bullish fill/text, bearish fill/text, neutral fill/text, header fill/text, score row fill/text.
The table also includes a **NY DR BIAS** row at the bottom showing the current day's confirmed Dealing Range direction and whether the filter is active.
---
### Colors
- **Bullish / Bearish Color** — Main signal colors used for OTE zone fills and entry arrows.
- **Zone Transparency %** — How transparent the OTE zone fill is (60–95%).
---
### Results Table (Table 1 — Summary)
A compact performance summary. Position is independently configurable.
- **Show Results Table** — Toggle on/off.
- **Summary Table Position** — Where to anchor Table 1 (settings + stats + P&L).
- **Table Size** — Tiny, Small, Normal, Large.
- **Timezone** — ET by default.
- **$ Per Point** — Set to 20 for NQ, 2 for MNQ, 50 for ES, 5 for MES.
- **Number of Contracts** — Scales all dollar P&L figures.
**Table 1 shows:**
- Active filter settings (stop method, swing filter, session, max range, target, VWAP, DR)
- Trades, Wins, Break Evens, Losses, Blocked signals, Win Rate
- Avg Win (pts + $), Avg Loss (pts + $), Total Won, Total Lost
- Net P&L (pts + $)
---
### Results Table (Table 2 — Hour/Slot Breakdown)
Separate table showing performance broken down by time slot. Works correctly for any signal timeframe — a 30m signal TF shows `9:30AM-10:00AM` style slots, not just hourly.
- **Hour Table Position** — Where to anchor Table 2. Default: Bottom Left (separate from Table 1).
- **Columns**: Time slot | W | BE | L | Net Pts
---
## Signal Logic Summary
A signal fires when ALL of the following are true:
1. Price swept the prior HTF candle's high (long) or low (short) within the sweep window
2. Price closed back inside the OTE zone for the first time
3. Within the session filter hours
4. Prior candle range did not exceed the max range filter
5. No intermediate HTF swing high/low was breached (swing filter)
6. VWAP filter passed (if enabled)
7. NY DR bias filter passed (if enabled and confirmed)
8. Past the time gate (if block-before-gate is enabled)
Signals blocked by filters 4–8 are shown as faded X arrows so you can visually audit what the filters are doing.
---
## Notes
- Works best on 1m and 5m charts with the Signal Timeframe set to 30m, 60m, or 240m.
- The indicator uses `max_bars_back=5000` to support longer lookback periods.
- DR boxes and lines use `xloc.bar_time` for precise timestamp-based placement.
- On chart timeframes below 5 minutes, a 5m security request is used for DR calculations to match the original DR/Initial Balance convention.
- All dollar P&L figures are estimates based on your $ Per Point and contract count settings — not a substitute for actual brokerage records.
Indicateur Pine Script®






















