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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。