OPEN-SOURCE SCRIPT
업데이트됨 ORB SESSIONS

## ORB SESSIONS — Multi-Session Opening Range Breakout + Retest Strategy
**ORB SESSIONS** is a multi-session Opening Range Breakout (ORB) strategy built for intraday trading across the **New York, Asia, and London** sessions, with optional overlays (PDH/PDL, session levels, FVGs) and an optional higher-timeframe bias dashboard. It is designed to standardize ORB execution with configurable **breakout vs retest** entry logic, **R-multiple targets**, optional **trailing-to-TP behavior**, and a **prop-firm “flat window”** to force risk compliance.
---
## Core concept
For each enabled session, the script:
1. Builds an **opening range** (high/low, optional midline) during a configurable ORB window.
2. Trades breakouts from that range using the selected **Entry Mode**:
* **Breakout**: enter on a confirmed close through the ORB boundary.
* **Retest Zone**: after breakout, wait for a wick back to the broken level.
* **Retest Midpoint**: after breakout, wait for a wick back to the ORB midpoint.
3. Manages risk via session-specific **Stop Loss methods** and up to **3 take-profits** expressed as **R:R multiples**.
4. Optionally uses a **trailing stop** mechanic that “arms” after price moves **N ticks beyond a TP**, then trails the stop to that TP level.
5. Optionally **re-arms** after a trade closes (with max trades/session, exit-type filter, direction filter, cooldown bars, and “bars inside ORB” requirements).
---
## What’s included
### Trading modules (per session)
* **Session 1: New York ORB** (enable, direction filter, ORB start/duration, session end, flatten at end, SL method, TP R:R and quantities).
* **Session 2: Asia ORB** (same structure).
* **Session 3: London ORB** (same structure).
### Filters & controls
* **Timezone selector** (all session times interpret in this timezone).
* **Day-of-week filter** (enable/disable specific weekdays).
* **Prop Firm Flat Window**: optionally flatten/block new entries during a specified time window.
### Visual overlays (optional)
* Historical ORB lines, optional midlines, labels.
* PDH/PDL, Asian/London/NY session overlays, and Fair Value Gaps (FVG) display.
---
## Recommended directions for use
1. **Apply to an intraday chart** (commonly 1m–15m).
2. Open **Settings → Global Settings**:
* Set **Timezone** to match your intended session definitions.
3. Open **Trade Settings (All Sessions)**:
* Choose **Entry Mode** (Breakout vs Retest Zone vs Retest Midpoint).
* Set **Contracts** and whether to show SL/TP visuals.
4. Configure each session you want to trade:
* Enable/disable sessions, choose direction (long/short/both), set ORB start + duration, and define session end/flatten behavior.
5. Configure exits:
* Pick an SL method (Midpoint / Opposite Side / Fixed Points) and set TP R:R levels and TP quantities per session.
6. Optional: turn on **Trailing Stop** and/or **Re-Arm**:
* Trailing: arms after N ticks beyond TP, then trails stop to TP.
* Re-arm: control max trades/session, cooldown bars, and re-arm conditions.
---
## Alerts (automation-ready)
This script is designed to run with **a single TradingView alert** that triggers only when the strategy actually fills orders.
**Create ONE alert** and set:
* **Condition**: this strategy
* **Trigger**: **Order fills only**
* **Message**: `{{strategy.order.alert_message}}`
The script attaches an order-specific alert payload at fill time (Buy/Sell/Exit), so your automation receives exactly what the strategy executed.
---
## Notes / expectations
* ORB behavior depends on how you define each session’s ORB window and the chart’s liquidity/volatility; optimize ORB duration + SL method + TP R:R per market.
* If you enable **Prop Firm Flat Window**, entries are blocked and positions can be forced flat during that period (use this to comply with rules).
Note : description written by ChatGPT
**ORB SESSIONS** is a multi-session Opening Range Breakout (ORB) strategy built for intraday trading across the **New York, Asia, and London** sessions, with optional overlays (PDH/PDL, session levels, FVGs) and an optional higher-timeframe bias dashboard. It is designed to standardize ORB execution with configurable **breakout vs retest** entry logic, **R-multiple targets**, optional **trailing-to-TP behavior**, and a **prop-firm “flat window”** to force risk compliance.
---
## Core concept
For each enabled session, the script:
1. Builds an **opening range** (high/low, optional midline) during a configurable ORB window.
2. Trades breakouts from that range using the selected **Entry Mode**:
* **Breakout**: enter on a confirmed close through the ORB boundary.
* **Retest Zone**: after breakout, wait for a wick back to the broken level.
* **Retest Midpoint**: after breakout, wait for a wick back to the ORB midpoint.
3. Manages risk via session-specific **Stop Loss methods** and up to **3 take-profits** expressed as **R:R multiples**.
4. Optionally uses a **trailing stop** mechanic that “arms” after price moves **N ticks beyond a TP**, then trails the stop to that TP level.
5. Optionally **re-arms** after a trade closes (with max trades/session, exit-type filter, direction filter, cooldown bars, and “bars inside ORB” requirements).
---
## What’s included
### Trading modules (per session)
* **Session 1: New York ORB** (enable, direction filter, ORB start/duration, session end, flatten at end, SL method, TP R:R and quantities).
* **Session 2: Asia ORB** (same structure).
* **Session 3: London ORB** (same structure).
### Filters & controls
* **Timezone selector** (all session times interpret in this timezone).
* **Day-of-week filter** (enable/disable specific weekdays).
* **Prop Firm Flat Window**: optionally flatten/block new entries during a specified time window.
### Visual overlays (optional)
* Historical ORB lines, optional midlines, labels.
* PDH/PDL, Asian/London/NY session overlays, and Fair Value Gaps (FVG) display.
---
## Recommended directions for use
1. **Apply to an intraday chart** (commonly 1m–15m).
2. Open **Settings → Global Settings**:
* Set **Timezone** to match your intended session definitions.
3. Open **Trade Settings (All Sessions)**:
* Choose **Entry Mode** (Breakout vs Retest Zone vs Retest Midpoint).
* Set **Contracts** and whether to show SL/TP visuals.
4. Configure each session you want to trade:
* Enable/disable sessions, choose direction (long/short/both), set ORB start + duration, and define session end/flatten behavior.
5. Configure exits:
* Pick an SL method (Midpoint / Opposite Side / Fixed Points) and set TP R:R levels and TP quantities per session.
6. Optional: turn on **Trailing Stop** and/or **Re-Arm**:
* Trailing: arms after N ticks beyond TP, then trails stop to TP.
* Re-arm: control max trades/session, cooldown bars, and re-arm conditions.
---
## Alerts (automation-ready)
This script is designed to run with **a single TradingView alert** that triggers only when the strategy actually fills orders.
**Create ONE alert** and set:
* **Condition**: this strategy
* **Trigger**: **Order fills only**
* **Message**: `{{strategy.order.alert_message}}`
The script attaches an order-specific alert payload at fill time (Buy/Sell/Exit), so your automation receives exactly what the strategy executed.
---
## Notes / expectations
* ORB behavior depends on how you define each session’s ORB window and the chart’s liquidity/volatility; optimize ORB duration + SL method + TP R:R per market.
* If you enable **Prop Firm Flat Window**, entries are blocked and positions can be forced flat during that period (use this to comply with rules).
Note : description written by ChatGPT
릴리즈 노트
Added buffer zone for entries.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.