OPEN-SOURCE SCRIPT
Initial Balance Breakout [samjNQ] v3

---samjNQ Initial Balance Breakout strategy---
**Initial Balance Breakout [MES] — Strategy Description**
Trades breakouts of the first-hour Initial Balance on the Micro E-mini S&P 500 (MES1!) using a clean set of filters to avoid noise and low-quality setups.
**How it works:**
The Initial Balance (IB) is defined as the high and low of the 9:30–10:30 AM ET window — the first hour of Regular Trading Hours. Once that window closes and the IB locks, the strategy waits for price to break above the IB High (long) or below the IB Low (short) during the trade window (10:30 AM–2:30 PM ET).
**Filters applied:**
- **VWAP trend filter** — only takes long breakouts when price is above VWAP, and short breakouts when price is below. Avoids trading against intraday momentum.
- **IB range filter** — skips days where the IB is too narrow (choppy, commissions eat returns) or too wide (extensions become unreachable). Configurable min/max in points.
- **2:30 PM cutoff** — no new entries in the last 90 minutes of the session. Late breakouts rarely have time to reach targets.
- **One trade per direction per day** — no re-entries after a stop-out.
**Exits:**
- Stop: opposite IB level (IB Low for longs, IB High for shorts)
- Target: 1.5× the IB range beyond the breakout level
- EOD flat: any open position is closed at 3:55 PM ET
**Chart visuals:**
- Yellow background = IB building window
- Blue lines = IB High / IB Low / Midpoint
- Green lines = long extension targets (T1 / T2)
- Red lines = short extension targets (T1 / T2)
- Orange line = VWAP
- Gray background = day filtered out by range rules
**Settings:** All parameters are adjustable — IB window, trade window, target multiples, stop mode, range filter thresholds, and VWAP filter toggle.
Built and backtested on MES1! 5-minute chart. Commission set to $2.25/contract, 1-tick slippage included.
---
**Initial Balance Breakout [MES] — Strategy Description**
Trades breakouts of the first-hour Initial Balance on the Micro E-mini S&P 500 (MES1!) using a clean set of filters to avoid noise and low-quality setups.
**How it works:**
The Initial Balance (IB) is defined as the high and low of the 9:30–10:30 AM ET window — the first hour of Regular Trading Hours. Once that window closes and the IB locks, the strategy waits for price to break above the IB High (long) or below the IB Low (short) during the trade window (10:30 AM–2:30 PM ET).
**Filters applied:**
- **VWAP trend filter** — only takes long breakouts when price is above VWAP, and short breakouts when price is below. Avoids trading against intraday momentum.
- **IB range filter** — skips days where the IB is too narrow (choppy, commissions eat returns) or too wide (extensions become unreachable). Configurable min/max in points.
- **2:30 PM cutoff** — no new entries in the last 90 minutes of the session. Late breakouts rarely have time to reach targets.
- **One trade per direction per day** — no re-entries after a stop-out.
**Exits:**
- Stop: opposite IB level (IB Low for longs, IB High for shorts)
- Target: 1.5× the IB range beyond the breakout level
- EOD flat: any open position is closed at 3:55 PM ET
**Chart visuals:**
- Yellow background = IB building window
- Blue lines = IB High / IB Low / Midpoint
- Green lines = long extension targets (T1 / T2)
- Red lines = short extension targets (T1 / T2)
- Orange line = VWAP
- Gray background = day filtered out by range rules
**Settings:** All parameters are adjustable — IB window, trade window, target multiples, stop mode, range filter thresholds, and VWAP filter toggle.
Built and backtested on MES1! 5-minute chart. Commission set to $2.25/contract, 1-tick slippage included.
---
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.