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. 🔒
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.