OPEN-SOURCE SCRIPT
Cập nhật [ A L P H A X ] Reversal - RSI Divergence + WPR Timing Engine

AlphaX Reversal — RSI Divergence Engine, Triple WPR Timing System, Multi-Confluence Confidence Scoring & Smart Entry/Exit Signals

AlphaX Reversal is a professional-grade reversal detection and signal system built on a dual-engine architecture combining RSI Divergence analysis with a triple-timeframe Williams %R timing system. It detects both regular and hidden divergences, scores every signal through a real-time multi-factor confidence engine, and produces clean tier-graded entry labels and exit markers — all governed by intelligent filters that eliminate low-quality setups automatically. Designed for reversal traders and swing scalpers on instruments like XAUUSD, indices, and forex majors.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 The Two-Engine Architecture — How It Works
AlphaX Reversal is powered by two independent engines that must both agree before any signal fires.
Engine 1 — RSI Divergence Detector
The first engine continuously monitors RSI pivot highs and lows against price pivot highs and lows, detecting four divergence types in real time:
When a valid divergence pair is found, a line is drawn on the price chart between the two pivot points — immediate visual confirmation of the structure that triggered the signal.
Engine 2 — Triple WPR Timing System
The second engine runs three Williams %R oscillators simultaneously at different periods:
A divergence signal from Engine 1 must be confirmed by a qualifying WPR condition from Engine 2 — a cross from an extreme zone, rising velocity, or a multi-bar recovery. This two-layer gate is what prevents AlphaX Reversal from firing on every minor oscillator wiggle.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Four Divergence Types
AlphaX Reversal detects and distinguishes between four divergence structures, each labeled directly on the signal:
Regular divergences receive a higher base confidence score than hidden divergences, reflecting their stronger reversal probability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏷 Signal Tiers — S / A / B
Every entry signal is graded into one of three tiers based on its real-time confidence score:
Tier, divergence type, and confidence score are all displayed directly on every label — you always know the quality of the setup at a glance, without checking the dashboard.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 Multi-Confluence Confidence Scoring
Every signal is scored by a real-time engine evaluating eight independent factors. Only signals meeting your configured Min Confidence % threshold are displayed.
Divergence Type Quality (up to 30 points)
WPR Extreme Depth (up to 20 points)
WPR Cross Timing (up to 15 points)
WPR Multi-Timeframe Alignment (up to 10 points)
WPR Slow Structural Context (up to 8 points)
Candle Confirmation (up to 7 points)
Volume (up to 5 points)
RSI Depth Bonus (up to 5 points)
Penalty Deductions
The default minimum confidence is 35% — optimized for XAUUSD 1-minute to filter noise while keeping valid reversal setups. Increase to 45–55% for cleaner signals on higher timeframes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚪 Exit Markers
Red dot markers indicating where the WPR system detects counter-trend momentum building — time to consider taking profit or tightening stops
Exit markers appear as small red dots and fire only after a position is open:
Two independent exit modes are available and can be toggled separately:
Use exit markers to take partial or full profit, tighten your stop loss, or pause new entries until the next signal confirms continuation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Live Dashboard
The built-in dashboard displays full system state in real time:
The dashboard can be positioned in any corner and text size is independently configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX Reversal — Step by Step
Step 1 — Watch for a Divergence Line
Step 2 — Enter on the Signal Label
Step 3 — Manage with the Dashboard
Step 4 — Exit on the Red Dot
Step 5 — Reset and Wait
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
RSI Divergence
WPR Timing
Signal Filters
Exits
Appearance & Dashboard
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions
All alert messages include {{ticker}} and {{interval}} placeholders for clean webhook integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Default Settings — Optimized For
The default configuration is specifically tuned for XAUUSD (Gold) on the 1-minute and 5-minute timeframes:
For other instruments or timeframes, adjust:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who want to see the divergence, understand the confirmation, and act with confidence.
AlphaX Reversal is a professional-grade reversal detection and signal system built on a dual-engine architecture combining RSI Divergence analysis with a triple-timeframe Williams %R timing system. It detects both regular and hidden divergences, scores every signal through a real-time multi-factor confidence engine, and produces clean tier-graded entry labels and exit markers — all governed by intelligent filters that eliminate low-quality setups automatically. Designed for reversal traders and swing scalpers on instruments like XAUUSD, indices, and forex majors.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 The Two-Engine Architecture — How It Works
AlphaX Reversal is powered by two independent engines that must both agree before any signal fires.
Engine 1 — RSI Divergence Detector
The first engine continuously monitors RSI pivot highs and lows against price pivot highs and lows, detecting four divergence types in real time:
- Regular Bullish Divergence — price makes a lower low while RSI makes a higher low (classic exhaustion reversal)
- Regular Bearish Divergence — price makes a higher high while RSI makes a lower high (classic distribution signal)
- Hidden Bullish Divergence — price makes a higher low while RSI makes a lower low (trend continuation after pullback)
- Hidden Bearish Divergence — price makes a lower high while RSI makes a higher high (distribution within a downtrend)
When a valid divergence pair is found, a line is drawn on the price chart between the two pivot points — immediate visual confirmation of the structure that triggered the signal.
Engine 2 — Triple WPR Timing System
The second engine runs three Williams %R oscillators simultaneously at different periods:
- WPR Fast — the primary signal generator, reacting quickly to momentum shifts
- WPR Medium — intermediate confirmation, filtering out fast WPR noise
- WPR Slow — macro trend direction, used to gate counter-trend entries
A divergence signal from Engine 1 must be confirmed by a qualifying WPR condition from Engine 2 — a cross from an extreme zone, rising velocity, or a multi-bar recovery. This two-layer gate is what prevents AlphaX Reversal from firing on every minor oscillator wiggle.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Four Divergence Types
AlphaX Reversal detects and distinguishes between four divergence structures, each labeled directly on the signal:
- REG Bull — Regular Bullish. Price exhaustion at a new low while momentum is already recovering. Strongest reversal signal.
- REG Bear — Regular Bearish. Price making new highs on declining momentum. Classic distribution.
- HID Bull — Hidden Bullish. A pullback within an uptrend — trend continuation setup.
- HID Bear — Hidden Bearish. A bounce within a downtrend — continuation of the bear move.
Regular divergences receive a higher base confidence score than hidden divergences, reflecting their stronger reversal probability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏷 Signal Tiers — S / A / B
Every entry signal is graded into one of three tiers based on its real-time confidence score:
- S-Tier (70%+) — the highest quality setups. All major confluence factors aligned. Brightest label, strongest visual weight.
- A-Tier (55–69%) — strong setups with most factors confirmed. Standard brightness.
- B-Tier (35–54%) — valid setups that meet the minimum threshold. Dimmer label color.
Tier, divergence type, and confidence score are all displayed directly on every label — you always know the quality of the setup at a glance, without checking the dashboard.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 Multi-Confluence Confidence Scoring
Every signal is scored by a real-time engine evaluating eight independent factors. Only signals meeting your configured Min Confidence % threshold are displayed.
Divergence Type Quality (up to 30 points)
- Regular divergence — 30 points
- Hidden divergence — 22 points
WPR Extreme Depth (up to 20 points)
- How deeply the Fast WPR penetrated into oversold or overbought territory before recovering — deeper penetration scores higher
WPR Cross Timing (up to 15 points)
- Cross from extreme zone — 15 points
- Strong WPR velocity — 10 points
- Multi-bar recovery in progress — 6 points
WPR Multi-Timeframe Alignment (up to 10 points)
- All three WPR timeframes simultaneously in extreme territory (Triple OS/OB) — 10 points
- Medium WPR in extreme zone — 7 points
WPR Slow Structural Context (up to 8 points)
- Slow WPR aligned with the signal direction adds structural confirmation
Candle Confirmation (up to 7 points)
- Strong-bodied candle closing in the signal direction — 7 points
- Weaker confirming close — 4 points
Volume (up to 5 points)
- Volume spike (1.5× average) — 5 points
- Above-average volume — 3 points
RSI Depth Bonus (up to 5 points)
- RSI below 25 (bull) or above 75 (bear) adds a bonus for extreme readings that reinforce the divergence
Penalty Deductions
- RSI at opposite extreme — up to 10 points deducted
- WPR Slow against the signal direction — up to 8 points deducted
- Extreme WPR velocity (likely spike or wick) — up to 5 points deducted
The default minimum confidence is 35% — optimized for XAUUSD 1-minute to filter noise while keeping valid reversal setups. Increase to 45–55% for cleaner signals on higher timeframes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚪 Exit Markers
Red dot markers indicating where the WPR system detects counter-trend momentum building — time to consider taking profit or tightening stops
Exit markers appear as small red dots and fire only after a position is open:
- During a long position — a bearish WPR signal triggers an exit dot above the bar
- During a short position — a bullish WPR signal triggers an exit dot below the bar
Two independent exit modes are available and can be toggled separately:
- Exit on Opposite Signal — exits the current position when a full opposing entry signal fires
- Exit on WPR Exhaustion — exits when WPR crosses into the opposing extreme zone beyond your configured threshold
Use exit markers to take partial or full profit, tighten your stop loss, or pause new entries until the next signal confirms continuation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Live Dashboard
The built-in dashboard displays full system state in real time:
- RSI — current value with color-coded extremes
- WPR Fast / Medium / Slow — all three values with directional coloring
- WPR Velocity — FLAT / RISING / FALLING / FAST with color grading
- Divergence Status — the active divergence type on the current bar
- Bull Confidence % — live score for the current bullish setup
- Bear Confidence % — live score for the current bearish setup
- Position — LONG / SHORT / FLAT tracking the active signal direction
- Open P&L — real-time unrealized profit and loss in price and percentage
- Volume — NORMAL / HIGH / SPIKE with current ratio vs 20-bar average
The dashboard can be positioned in any corner and text size is independently configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX Reversal — Step by Step
Step 1 — Watch for a Divergence Line
- When a divergence line appears connecting two pivots on the chart, Engine 1 has detected a valid structure
- Check the dashboard Divergence Status row to confirm the type
Step 2 — Enter on the Signal Label
- When the label fires, both engines have confirmed the setup
- The label shows tier (S/A/B), divergence type (REG/HID), and confidence score directly on the bar
- Place your stop loss beyond the price pivot that formed the divergence
Step 3 — Manage with the Dashboard
- Monitor WPR Velocity and WPR Fast — rising values confirm the reversal is following through
- Flat or reversing velocity warns that momentum is stalling early
Step 4 — Exit on the Red Dot
- When a red exit dot appears, counter-trend momentum has built sufficiently to trigger the exit engine
- Take partial or full profit, or tighten your stop
Step 5 — Reset and Wait
- After an exit, wait for the next divergence structure before re-entering
- Do not force entries between signals
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
- 🔬 Dual-engine architecture — RSI Divergence and triple WPR timing must both confirm before any signal fires
- 📐 Four divergence types — Regular Bullish, Regular Bearish, Hidden Bullish, Hidden Bearish — detected and labeled distinctly
- 🏷 Three signal tiers (S / A / B) — confidence-graded labels with visual weight matching signal quality
- 🧠 Multi-factor confidence scoring — divergence type, WPR depth, velocity, timing, candle body, volume, RSI depth, and penalties
- 📉 Divergence lines drawn automatically — visual confirmation of the exact pivot pair that triggered the signal
- 🔴 Smart exit markers — red dots that fire only after a position is open, triggered by WPR exhaustion or opposing signal
- 📋 Full live dashboard — RSI, three WPR values, velocity, divergence status, confidence scores, position, P&L, and volume in one panel
- ⏱ Signal cooldown filter — prevents repeated signals during volatile whipsaw conditions
- 🎨 Cohesive dual-tone color theme — yellow-green for bullish, red for bearish, gray for exits and neutral states
- 🔔 17 alert conditions — tiered entry alerts, exit alerts, divergence detection alerts, and WPR extreme alerts
- ⚙ Fully configurable — all periods, thresholds, divergence widths, colors, and exit modes adjustable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
RSI Divergence
- RSI Period — base RSI calculation period (default: 9)
- RSI Pivot Lookback — pivot detection sensitivity (default: 3)
- Max Divergence Width — maximum bars between the two pivot points (default: 40)
- Min Divergence Width — minimum bars between the two pivot points (default: 5)
- Show Divergence Lines — toggle the connecting lines on the price chart
WPR Timing
- WPR Fast / Medium / Slow Period — three independent WPR periods (defaults: 8 / 21 / 55)
- WPR Oversold / Overbought Levels — extreme zone thresholds (defaults: -82 / -18)
Signal Filters
- Min Confidence % — minimum score to display a signal (default: 35%)
- Signal Cooldown — minimum bars between consecutive signals (default: 6)
- Require Volume Confirm — optional volume gate using a minimum ratio vs 20-bar average
Exits
- Exit on Opposite Signal — exit the current position when an opposing signal fires
- Exit on WPR Exhaustion — exit when WPR crosses into the opposing extreme zone
- WPR Exit Bull / Bear Levels — configurable WPR thresholds for the exhaustion exit
Appearance & Dashboard
- Label Size — Tiny / Small / Normal
- Dashboard Text Size — Tiny / Small / Normal
- Show Dashboard — toggle the live overlay panel
- Dashboard Position — Top Left / Top Right / Bottom Left / Bottom Right
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions
- S-Tier Bull Reversal — bullish signals scoring 70%+
- A-Tier Bull Reversal — bullish signals scoring 55–69%
- B-Tier Bull Reversal — bullish signals scoring 35–54%
- S-Tier Bear Reversal — bearish signals scoring 70%+
- A-Tier Bear Reversal — bearish signals scoring 55–69%
- B-Tier Bear Reversal — bearish signals scoring 35–54%
- Any Bull Reversal — all bullish entry signals combined
- Any Bear Reversal — all bearish entry signals combined
- Any Reversal Signal — all entries combined
- Bull Exit — long position exit signal
- Bear Exit — short position exit signal
- Any Exit — all exits combined
- Regular Bull Divergence Detected
- Regular Bear Divergence Detected
- Hidden Bull Divergence Detected
- Hidden Bear Divergence Detected
- Triple WPR Oversold — all three WPR periods simultaneously in oversold territory
- Triple WPR Overbought — all three WPR periods simultaneously in overbought territory
All alert messages include {{ticker}} and {{interval}} placeholders for clean webhook integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Default Settings — Optimized For
The default configuration is specifically tuned for XAUUSD (Gold) on the 1-minute and 5-minute timeframes:
- Confidence threshold at 35% filters low-quality setups while keeping valid reversal signals
- Cooldown at 6 bars prevents label spam during volatile back-and-forth conditions
- WPR periods (8 / 21 / 55) calibrated for gold's fast-moving intraday reversal structure
- Divergence width of 5–40 bars captures the relevant reversal structures without reaching too far back
For other instruments or timeframes, adjust:
- Higher timeframes (15m, 1H) — increase RSI Pivot Lookback to 4–5, increase Min Confidence to 40–50%, widen Max Divergence Width to 50–60
- Forex majors — defaults work well; reduce RSI Period to 7 for faster detection
- Indices (NAS100, US30) — increase WPR Slow to 89 for broader trend context
- Less noise — increase Min Confidence %, increase Cooldown, reduce Max Divergence Width
- More signals — decrease Min Confidence %, decrease Cooldown, widen divergence window
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
- 🥇 Gold (XAUUSD) reversal traders — built and tested on gold's sharp intraday reversal character
- 📉 Forex and index swing traders — applicable to any instrument that exhibits momentum divergence at turning points
- 🧠 Systematic traders — the tiered confidence scoring gives a quantitative quality framework, not just visual arrows
- 📈 Traders who want to know why — every signal shows its tier, divergence type, and score directly on the label
- ⚠ Traders who struggle with overtrading — the dual-engine confirmation gate and confidence threshold physically prevent weak signals from appearing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
- All signals are confirmed on bar close — no repainting
- Divergence lines connect the actual price pivot points used to generate the signal
- The position tracker and P&L display are internal to the indicator and do not connect to your broker account
- Maximum 500 labels and 500 lines — on very low timeframes with extended history, oldest drawings may be removed automatically by TradingView's rendering limits
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who want to see the divergence, understand the confirmation, and act with confidence.
Phát hành các Ghi chú
Minor style changes.Phát hành các Ghi chú
IMPROVEMENTS - Summary of what changed- Row count expanded from 12 to 22 with four clean section separators: OSCILLATORS / DIVERGENCE / CONFIDENCE / TRADE STATUS
- Frame color changed to colBullPrimary (yellow-green accent) for a sharper border
- All WPR rows now show period length in the label and a [OB/OS/MID] zone tag alongside the value
- WPR Alignment row added — shows Bull Zone / Bear Zone / Neutral based on slow and medium WPR position
- Triple WPR Confluence row added with a subtle tinted background when all three are extreme
- Divergence row now has a background tint when active, plus a TYPE NOTE row explaining whether it's a reversal or continuation signal
- Confidence tiers (S / A / B / BELOW MIN) now shown inline on the confidence rows instead of only on chart labels
- Entry Price row added so you can see your exact entry without looking at the chart
- Bars in Trade row added — useful timing reference for managing exits
- WPR Exit Watch row added — warns when WPR is approaching your configured exit level while in a trade
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.
🌐 alphax.trading
Institutional Grade Signals --> Engineered for Retail
💎ᴠɪᴘ tradingview.com/v/TaXohZvb/
[ A L P H A X ] PRIME - Premium Signal Engine
🔢 alphax.trading/resources/calculators
AlphaX Calculators
Institutional Grade Signals --> Engineered for Retail
💎ᴠɪᴘ tradingview.com/v/TaXohZvb/
[ A L P H A X ] PRIME - Premium Signal Engine
🔢 alphax.trading/resources/calculators
AlphaX Calculators
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.
🌐 alphax.trading
Institutional Grade Signals --> Engineered for Retail
💎ᴠɪᴘ tradingview.com/v/TaXohZvb/
[ A L P H A X ] PRIME - Premium Signal Engine
🔢 alphax.trading/resources/calculators
AlphaX Calculators
Institutional Grade Signals --> Engineered for Retail
💎ᴠɪᴘ tradingview.com/v/TaXohZvb/
[ A L P H A X ] PRIME - Premium Signal Engine
🔢 alphax.trading/resources/calculators
AlphaX Calculators
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.