OPEN-SOURCE SCRIPT
Sunmool's NY Lunch Model Backtesting

ICT NY Lunch Model Backtesting (12:00–13:00 NY) 🗽🍔
This research indicator tests an ICT narrative using the New York lunch window (12:00–13:00 America/New_York). It records that hour’s high/low and measures, during the post-lunch session (default 13:00–16:00), how often:
⬆️ If the afternoon trends up, the Lunch Low gets swept first.
⬇️ If the afternoon trends down, the Lunch High gets swept first.
It reports these as conditional probabilities, not trade signals. 📈
👀 What it shows
🟦 Lunch Range box (toggle): high/low from 12:00–13:00 NY
🔻🔺 Sweep signals (bar-anchored)
Low sweep: triangle below bar + optional “L”
High sweep: triangle above bar + optional “H”
🧱 Optional small box wrapping the swept candle
📊 Stats table (top-right)
P(L-swept | Up) — % of Up-days where Lunch Low was swept
P(H-swept | Down) — % of Down-days where Lunch High was swept
🔁 Contradictions + sample sizes (Up-days / Down-days)
🎯 Direction logic (Up/Down)
Anchor: 13:00 open (pmOpen) ⏰
Threshold: ATR × multiple or % from 13:00
Close ≥ pmOpen + threshold → Up-day
Close ≤ pmOpen − threshold → Down-day
Tiny moves under the threshold are ignored to reduce noise 🧹
⚙️ Inputs
🌐 Timezone: America/New_York (DST handled)
🍽️ Lunch window: 1200–1300
🕓 Post-lunch window: default 1300–1600 (try 17:00/20:00 for sensitivity)
📐 Trend threshold: ATR / Percent (with length/multiple or % level)
📅 Weekdays-only toggle (FX/Equities style)
👁️ Display toggles: Lunch box / sweep arrows / sweep text / sweep candle box / stats table
🔔 TF hint when chart TF > 15m
🧭 How to use
Use 5–15m charts for accurate lunch range capture.
Scroll ~1 year for meaningful samples.
Run sensitivity checks: vary ATR/% thresholds and the post-lunch end time.
For crypto, compare with vs without weekends. 🚀
🧠 Reading the results
High P(L-swept | Up) with a solid Up-day count ⇒ on up afternoons, lunch low is often swept.
High P(H-swept | Down) ⇒ on down afternoons, lunch high is often swept.
Lower Contradictions = cleaner tendency.
Remember: this is a probabilistic tendency, not a rule. 🎲
📝 Notes & limits
All markers (arrows, text, sweep boxes) are bar-anchored; the lunch range box is a research overlay you can toggle.
Real-time vs historical bar building can differ—interpret on bar close. 🔒
This research indicator tests an ICT narrative using the New York lunch window (12:00–13:00 America/New_York). It records that hour’s high/low and measures, during the post-lunch session (default 13:00–16:00), how often:
⬆️ If the afternoon trends up, the Lunch Low gets swept first.
⬇️ If the afternoon trends down, the Lunch High gets swept first.
It reports these as conditional probabilities, not trade signals. 📈
👀 What it shows
🟦 Lunch Range box (toggle): high/low from 12:00–13:00 NY
🔻🔺 Sweep signals (bar-anchored)
Low sweep: triangle below bar + optional “L”
High sweep: triangle above bar + optional “H”
🧱 Optional small box wrapping the swept candle
📊 Stats table (top-right)
P(L-swept | Up) — % of Up-days where Lunch Low was swept
P(H-swept | Down) — % of Down-days where Lunch High was swept
🔁 Contradictions + sample sizes (Up-days / Down-days)
🎯 Direction logic (Up/Down)
Anchor: 13:00 open (pmOpen) ⏰
Threshold: ATR × multiple or % from 13:00
Close ≥ pmOpen + threshold → Up-day
Close ≤ pmOpen − threshold → Down-day
Tiny moves under the threshold are ignored to reduce noise 🧹
⚙️ Inputs
🌐 Timezone: America/New_York (DST handled)
🍽️ Lunch window: 1200–1300
🕓 Post-lunch window: default 1300–1600 (try 17:00/20:00 for sensitivity)
📐 Trend threshold: ATR / Percent (with length/multiple or % level)
📅 Weekdays-only toggle (FX/Equities style)
👁️ Display toggles: Lunch box / sweep arrows / sweep text / sweep candle box / stats table
🔔 TF hint when chart TF > 15m
🧭 How to use
Use 5–15m charts for accurate lunch range capture.
Scroll ~1 year for meaningful samples.
Run sensitivity checks: vary ATR/% thresholds and the post-lunch end time.
For crypto, compare with vs without weekends. 🚀
🧠 Reading the results
High P(L-swept | Up) with a solid Up-day count ⇒ on up afternoons, lunch low is often swept.
High P(H-swept | Down) ⇒ on down afternoons, lunch high is often swept.
Lower Contradictions = cleaner tendency.
Remember: this is a probabilistic tendency, not a rule. 🎲
📝 Notes & limits
All markers (arrows, text, sweep boxes) are bar-anchored; the lunch range box is a research overlay you can toggle.
Real-time vs historical bar building can differ—interpret on bar close. 🔒
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。