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 อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน