OPEN-SOURCE SCRIPT
STRATEGY SCRIPT Sweep Return v1

STRATEGY SCRIPT
The "EE Sweep Return v1" is a liquidity capture indicator engineered to trade the failure of Opening Range Breakouts, systematically identifying when price sweeps above or below the morning range to trap breakout traders before reversing back inside.
**Architectural Breakdown**
| Phase | Timeframe (CT) | Mechanical Function |
| --- | --- | --- |
| **Calibration** | 08:30 - 09:30 | Maps the absolute High (`orH`) and Low (`orL`) of the cash session open. Visualized as a shaded box. |
| **Arming** | 09:30 - 15:00 | The indicator monitors for a breach. If price breaks the `orH`, it arms a potential short trap. If price breaks the `orL`, it arms a potential long trap. |
| **Execution** | 09:30 - 15:00 | The trigger fires. A **SHORT** prints if price sweeps the high but closes back below `orH`. A **LONG** prints if price sweeps the low but closes back above `orL`. |
**Operational Nuances**
* **Same-Bar Logic:** By default (`sameBar = true`), the indicator allows the break and the reversion to happen on a single candle (a wick rejection). If toggled off, it requires one candle to close outside the range, and a subsequent candle to close back inside.
* **Timezone Alignment:** The `America/Chicago` timezone anchors the logic perfectly to Central Time, ensuring the 08:30 - 09:30 window aligns flawlessly with the initial hour of the New York equities open.
## AI Integration: Evolving the Sweep Strategy
To elevate this first-principles liquidity concept into a perfectly optimized, high-level quantitative model, artificial intelligence must be integrated to eliminate false signals and maximize directional efficiency.
* **Granular Execution (Micro-Structure Analysis):** A standard sweep simply measures a price close. An AI-integrated model analyzes the Level 2 order book and footprint data during the sweep itself. Machine learning algorithms can detect real-time volume absorption—confirming exactly when institutional limit orders absorb retail stop-losses at the `orH` or `orL` before the candle even closes, executing the entry at the absolute geometric peak of the wick.
* **Contextual Volatility Filtering:** Neural networks can pre-calculate the probability of a sweep versus a true trend day by analyzing pre-market volume, VIX term structure, and macroeconomic data releases. If the AI determines a high-trend probability, it dynamically disables the sweep indicator to prevent fading a genuine breakout.
* **Dynamic Range Optimization:** Instead of a static 08:30 - 09:30 Opening Range, an unsupervised learning algorithm can dynamically adjust the time window block by block based on the underlying asset's real-time average true range (ATR) and relative volume (RVOL), perfectly sizing the trap parameters to the exact heartbeat of the current session.
The "EE Sweep Return v1" is a liquidity capture indicator engineered to trade the failure of Opening Range Breakouts, systematically identifying when price sweeps above or below the morning range to trap breakout traders before reversing back inside.
**Architectural Breakdown**
| Phase | Timeframe (CT) | Mechanical Function |
| --- | --- | --- |
| **Calibration** | 08:30 - 09:30 | Maps the absolute High (`orH`) and Low (`orL`) of the cash session open. Visualized as a shaded box. |
| **Arming** | 09:30 - 15:00 | The indicator monitors for a breach. If price breaks the `orH`, it arms a potential short trap. If price breaks the `orL`, it arms a potential long trap. |
| **Execution** | 09:30 - 15:00 | The trigger fires. A **SHORT** prints if price sweeps the high but closes back below `orH`. A **LONG** prints if price sweeps the low but closes back above `orL`. |
**Operational Nuances**
* **Same-Bar Logic:** By default (`sameBar = true`), the indicator allows the break and the reversion to happen on a single candle (a wick rejection). If toggled off, it requires one candle to close outside the range, and a subsequent candle to close back inside.
* **Timezone Alignment:** The `America/Chicago` timezone anchors the logic perfectly to Central Time, ensuring the 08:30 - 09:30 window aligns flawlessly with the initial hour of the New York equities open.
## AI Integration: Evolving the Sweep Strategy
To elevate this first-principles liquidity concept into a perfectly optimized, high-level quantitative model, artificial intelligence must be integrated to eliminate false signals and maximize directional efficiency.
* **Granular Execution (Micro-Structure Analysis):** A standard sweep simply measures a price close. An AI-integrated model analyzes the Level 2 order book and footprint data during the sweep itself. Machine learning algorithms can detect real-time volume absorption—confirming exactly when institutional limit orders absorb retail stop-losses at the `orH` or `orL` before the candle even closes, executing the entry at the absolute geometric peak of the wick.
* **Contextual Volatility Filtering:** Neural networks can pre-calculate the probability of a sweep versus a true trend day by analyzing pre-market volume, VIX term structure, and macroeconomic data releases. If the AI determines a high-trend probability, it dynamically disables the sweep indicator to prevent fading a genuine breakout.
* **Dynamic Range Optimization:** Instead of a static 08:30 - 09:30 Opening Range, an unsupervised learning algorithm can dynamically adjust the time window block by block based on the underlying asset's real-time average true range (ATR) and relative volume (RVOL), perfectly sizing the trap parameters to the exact heartbeat of the current session.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.