OPEN-SOURCE SCRIPT
Cập nhật MeanReversion_tradeALERT

Overview The Apex Reversal Predictor v2.5 is a specialized mean reversion strategy designed for scalping high-volatility assets like NQ (Nasdaq), ES (S&P 500), and Crypto. While most indicators chase breakouts, this system hunts for "Liquidity Sweeps"—moments where the market briefly breaks a key level to trap retail traders before snapping back to the true value (VWAP).
This is not just a signal indicator; it is a full Trade Manager that calculates your Entry, Stop Loss, and Take Profit levels automatically based on volatility (ATR).
The Logic: Why This Works Markets act like a rubber band. They can only stretch so far from their average price before snapping back. This script combines three layers of logic to identify these snap-back points:
The Stretch (Sigma Score): Measures how far price is from the VWAP relative to ATR. If the score > 2.0, the "rubber band" is overextended.
The Trap (Liquidity Sweep): Identifies Pivot Highs/Lows. It waits for price to break a pivot (luring in breakout traders) and then immediately reverse (trapping them).
The Exhaustion (RSI): Confirms that momentum is Overbought/Oversold to prevent trading against a strong trend.
Key Features
Dynamic Lines: Automatically draws Blue (Entry), Red (SL), and Green (TP) lines on the chart for active trades.
Smart Targets: Two modes for taking profit:
Mean Reversion: Targets the VWAP line (High Win Rate).
Fixed Ratio: Targets a specific Risk:Reward (e.g., 1:2).
Live Dashboard: Tracks Win Rate, Net Points, and the live "Stretch Score" in the bottom right corner.
Alert Ready: Formatted JSON alerts for easy integration with Discord or trading bots.
How & When to Use (User Guide)
1. Best Timeframes
5-Minute (5m): Best for NQ and volatile stocks (TSLA, NVDA). Filters out 1-minute noise but catches the intraday reversals.
15-Minute (15m): Best for Forex or slower-moving indices (ES).
2. The Setup Checklist Before taking a trade, look at the Dashboard in the bottom right:
Step 1: Check the "Stretch (Sigma)". Is it Orange or Red? This means price is extended and ripe for a reversal. If it's Green, the market is calm—be careful.
Step 2: Wait for the Signal.
"Apex BUY" (Green Label): Price swept a low and closed green.
"Apex SELL" (Red Label): Price swept a high and closed red.
Step 3: Execute. Enter at the close of the signal candle. Set your stop loss at the Red Line provided by the script.
3. Warning / When NOT to Use
Strong Trending Days: If the market is trending heavily (e.g., creating higher highs all day without looking back), do not fight the trend.
News Events: Avoid using this during CPI, FOMC, or NFP releases. The "rubber band" logic breaks during news because volatility expands indefinitely.
This is not just a signal indicator; it is a full Trade Manager that calculates your Entry, Stop Loss, and Take Profit levels automatically based on volatility (ATR).
The Logic: Why This Works Markets act like a rubber band. They can only stretch so far from their average price before snapping back. This script combines three layers of logic to identify these snap-back points:
The Stretch (Sigma Score): Measures how far price is from the VWAP relative to ATR. If the score > 2.0, the "rubber band" is overextended.
The Trap (Liquidity Sweep): Identifies Pivot Highs/Lows. It waits for price to break a pivot (luring in breakout traders) and then immediately reverse (trapping them).
The Exhaustion (RSI): Confirms that momentum is Overbought/Oversold to prevent trading against a strong trend.
Key Features
Dynamic Lines: Automatically draws Blue (Entry), Red (SL), and Green (TP) lines on the chart for active trades.
Smart Targets: Two modes for taking profit:
Mean Reversion: Targets the VWAP line (High Win Rate).
Fixed Ratio: Targets a specific Risk:Reward (e.g., 1:2).
Live Dashboard: Tracks Win Rate, Net Points, and the live "Stretch Score" in the bottom right corner.
Alert Ready: Formatted JSON alerts for easy integration with Discord or trading bots.
How & When to Use (User Guide)
1. Best Timeframes
5-Minute (5m): Best for NQ and volatile stocks (TSLA, NVDA). Filters out 1-minute noise but catches the intraday reversals.
15-Minute (15m): Best for Forex or slower-moving indices (ES).
2. The Setup Checklist Before taking a trade, look at the Dashboard in the bottom right:
Step 1: Check the "Stretch (Sigma)". Is it Orange or Red? This means price is extended and ripe for a reversal. If it's Green, the market is calm—be careful.
Step 2: Wait for the Signal.
"Apex BUY" (Green Label): Price swept a low and closed green.
"Apex SELL" (Red Label): Price swept a high and closed red.
Step 3: Execute. Enter at the close of the signal candle. Set your stop loss at the Red Line provided by the script.
3. Warning / When NOT to Use
Strong Trending Days: If the market is trending heavily (e.g., creating higher highs all day without looking back), do not fight the trend.
News Events: Avoid using this during CPI, FOMC, or NFP releases. The "rubber band" logic breaks during news because volatility expands indefinitely.
Phát hành các Ghi chú
updated Alert names to match the indicator name Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
@PannchamH
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
@PannchamH
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.