OPEN-SOURCE SCRIPT
Master Strategy: BTC W1 Mean Reversion [Institutional SOP]

Overview This is an institutional-grade Mean Reversion and Range Rotation strategy designed specifically for Bitcoin (BTC/USDT) Perpetual Futures. It operates on the philosophy that liquidity resides at the extremes of the previous week's range (Previous Week High/Low). The strategy looks for false breakouts (Sweeps) followed by a confirmed return to the range (Reclaim), targeting the weekly equilibrium (EQ).
Core Logic: The Deviation Play Unlike standard breakout strategies, this indicator hunts for trapped liquidity.
Weekly Levels (Fixed): It calculates PWH (Previous Week High) and PWL (Previous Week Low) based on confirmed, closed weekly data. These levels act as the "Box" for the current week.
The Sweep: We wait for price to pierce the PWH or PWL (taking liquidity/stops). The script uses a dynamic ATR-based threshold to filter out noise (micro-pokes).
The Reclaim (4H Close): A signal is generated ONLY if a 4H candle closes back inside the weekly range shortly after the sweep. This confirms rejection of higher/lower prices.
The Entry: The script suggests a Limit Order at the retested level (PWH/PWL) to maximize R:R.
Institutional Quality Filters ("Kill Switches") To prevent trading in unfavorable conditions, the script includes strict SOP (Standard Operating Procedure) filters:
Trend Filter (ADX): Blocks mean reversion signals if the daily trend is too strong (ADX > 25).
Expansion Filter: Blocks signals if price accepted levels outside the range for too long (prevents fighting a true breakout).
Weekly Range Filter: Filters out weeks that are statistically too tight (chop) or too wide (expansion).
Time Filter: A reclaim must happen within a set number of 4H bars after the sweep (default: 3).
Key Features
Zero Repainting: Logic is based strictly on closed candles ([1], [2], [3]).
State Machine Logic: Uses internal memory to track sweeps regardless of chart timeframe glitches.
Operational Dashboard: Displays current status, countdown to next decision candle (4H close), and exact parameters for the last valid signal (Entry, SL, TP).
Unified Alerting: A single "Any function call" alert handles both Long and Short scenarios dynamically.
Clean Visuals: Levels are plotted with line breaks to avoid visual clutter between weeks.
How to Use
Timeframe: Set your chart to 4H. This is crucial as the logic relies on 4H closes.
Signals: Wait for the "4H RECLAIM" label.
Execution: Place a Limit Order at the suggested Level (PWH/PWL).
Stop Loss: Use the calculated SL provided by the indicator (Swing extreme + ATR buffer).
Target: TP1 is always the EQ (Equilibrium/Mid-range).
Core Logic: The Deviation Play Unlike standard breakout strategies, this indicator hunts for trapped liquidity.
Weekly Levels (Fixed): It calculates PWH (Previous Week High) and PWL (Previous Week Low) based on confirmed, closed weekly data. These levels act as the "Box" for the current week.
The Sweep: We wait for price to pierce the PWH or PWL (taking liquidity/stops). The script uses a dynamic ATR-based threshold to filter out noise (micro-pokes).
The Reclaim (4H Close): A signal is generated ONLY if a 4H candle closes back inside the weekly range shortly after the sweep. This confirms rejection of higher/lower prices.
The Entry: The script suggests a Limit Order at the retested level (PWH/PWL) to maximize R:R.
Institutional Quality Filters ("Kill Switches") To prevent trading in unfavorable conditions, the script includes strict SOP (Standard Operating Procedure) filters:
Trend Filter (ADX): Blocks mean reversion signals if the daily trend is too strong (ADX > 25).
Expansion Filter: Blocks signals if price accepted levels outside the range for too long (prevents fighting a true breakout).
Weekly Range Filter: Filters out weeks that are statistically too tight (chop) or too wide (expansion).
Time Filter: A reclaim must happen within a set number of 4H bars after the sweep (default: 3).
Key Features
Zero Repainting: Logic is based strictly on closed candles ([1], [2], [3]).
State Machine Logic: Uses internal memory to track sweeps regardless of chart timeframe glitches.
Operational Dashboard: Displays current status, countdown to next decision candle (4H close), and exact parameters for the last valid signal (Entry, SL, TP).
Unified Alerting: A single "Any function call" alert handles both Long and Short scenarios dynamically.
Clean Visuals: Levels are plotted with line breaks to avoid visual clutter between weeks.
How to Use
Timeframe: Set your chart to 4H. This is crucial as the logic relies on 4H closes.
Signals: Wait for the "4H RECLAIM" label.
Execution: Place a Limit Order at the suggested Level (PWH/PWL).
Stop Loss: Use the calculated SL provided by the indicator (Swing extreme + ATR buffer).
Target: TP1 is always the EQ (Equilibrium/Mid-range).
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.