OPEN-SOURCE SCRIPT
更新済

[ A L P H A X ] Edge - Support/Resistance | Breakout Entry

24 436
AlphaX Edge — Support/Resistance × Breakout × Trend Confluence | Multi-Factor Confidence Scoring, Smart S/R Zones & Squeeze Detection

AlphaX Edge is a professional multi-confluence trading system that combines six independent analytical layers into a single unified signal engine. Rather than relying on any single indicator, it requires agreement across Support/Resistance structure, trend direction, momentum, volume, ADX strength, and squeeze dynamics before generating a signal — producing fewer, higher-quality setups and filtering out the noise that plagues single-indicator systems. Designed for intraday and swing traders across all instruments and timeframes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📸 Visual Overview
スナップショット
The chart displays color-coded S/R zones, breakout and retest labels, trend structure labels, EMA ribbons, RSI divergence diamonds, and triangle entry signals — all governed by a real-time dashboard showing every active market condition at a glance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 The Six Analytical Layers
1 — Smart Support & Resistance Zones
AlphaX Edge automatically detects, merges, and manages S/R zones using pivot-based swing detection. Each zone is:

  • []Built from confirmed swing highs and lows using a configurable swing length
    []Merged automatically when two levels fall within a user-defined ATR multiplier — preventing zone clutter
    []Color-coded by role: yellow-green for confirmed support, red for confirmed resistance, gray for untested levels
    []Aged out after a configurable number of bars to keep the chart clean and relevant
  • Upgraded from neutral to confirmed only after a minimum number of touches — preventing weak levels from triggering signals

When price approaches a confirmed zone from above, the zone acts as resistance. When approached from below, it acts as support. Broken zones flip polarity — a broken resistance becomes support and vice versa — and are tracked for retest opportunities.
2 — Breakout Detection with Anti-Fake Filter
A breakout is confirmed only when all of the following conditions are met simultaneously:

  • []The candle body closes convincingly beyond the zone boundary (not just a wick poke)
    []The candle body represents at least 40% of the total candle range — no doji or indecision candles
    []Volume confirms participation (configurable: require spike or simply above-average volume)
    []A cooldown timer prevents repeated breakout labels during choppy back-and-forth action
  • RSI is not at an extreme overbought/oversold level — unless ADX confirms the trend is genuinely strong (preventing exhaustion breakout entries)

3 — Trend Structure Analysis
AlphaX Edge tracks market structure using higher swing pivots — independently from the S/R zone engine. It identifies:

  • []Higher Highs + Higher Lows → confirmed uptrend structure
    []Lower Highs + Lower Lows → confirmed downtrend structure
    []Trend line drawn automatically connecting the most recent pivot lows (uptrend) or pivot highs (downtrend)
    []UPTREND ▲ and DOWNTREND ▼ labels fire when structure shifts — with a configurable cooldown to prevent label spam

4 — EMA Trend Ribbon
Three EMAs provide structural context at all times:

  • []Fast EMA (21) — yellow-green cross marks — immediate momentum direction
    []Medium EMA (50) — gray line — intermediate trend filter
  • Slow EMA (200) — dark gray thick line — macro structural backbone

When all three are fanned in sequence (Fast > Medium > Slow for bull, reverse for bear), the trend is healthy and signals carry higher weight in the confluence engine. When they converge and flatten, the market is ranging — a visual warning to stand aside.
5 — Momentum Engine (RSI + MACD + Stochastic)
Three oscillators run simultaneously and vote on momentum direction:

  • []RSI slope direction with smoothing — avoids single-bar noise
    []MACD line vs signal cross and histogram direction
  • Stochastic K vs D with overbought/oversold zone filtering

A minimum of two out of three must agree before momentum is considered bullish or bearish. This voting approach prevents a single oscillator spike from generating false signals.
6 — Bollinger Squeeze Detection
The squeeze engine monitors when Bollinger Bands contract inside Keltner Channels — indicating coiled volatility about to expand. When the squeeze fires (bands break outside the channels), directional momentum is assessed to determine which way the expansion is likely to break. Squeeze entries carry bonus weight in the confluence scoring system.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 Confluence Scoring & Confidence System
Every signal is evaluated across 10 independent factors, each contributing one point to the confluence score. Only signals meeting your configured minimum score threshold are displayed.
The 10 factors per direction:

  • []✓ SUP — Price is at a confirmed support zone (bull) or resistance zone (bear)
    []✓ BRK — A valid breakout has just occurred in the signal direction
    []✓ RET — A confirmed post-breakout retest is occurring
    []✓ TRD — Trend structure (HH+HL or LH+LL) aligns with signal direction
    []✓ MOM — At least 2 of 3 momentum oscillators confirm direction
    []✓ PAT — A candlestick pattern is present (engulfing, pin bar, or RSI divergence)
    []✓ VOL — Volume is above average and candle closes in the signal direction
    []✓ EMA — EMA ribbon is aligned or price is on the correct side of the 200 EMA
    []✓ ADX — ADX confirms a trending market with directional dominance
    []✓ SQZ — Squeeze has fired or is expanding in the signal direction

スナップショット
Alongside the 10-point score, a confidence percentage (0–100%) is calculated using a weighted system that gives higher importance to structural factors (retest = 20 pts, breakout = 16 pts, support/resistance = 14 pts) and applies heavy penalties for counter-trend signals, overbought/oversold exhaustion, no-trend conditions, overextension from EMAs, and low volume. The resulting grade ranges from D to A+.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Signal Types — Complete Entry Guide
AlphaX Edge produces four distinct signal types. Below is a ranked guide to how each should be traded, from highest to lowest quality.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🥇 RANK 1 — Breakout + Volume Spike Confirmation (Highest Quality)
What it looks like: A BREAKOUT ▲ or BREAKOUT ▼ label appears, and within 1–2 candles a volume spike dot (●) appears in the same direction. The confluence triangle signal fires.
Why it's the strongest: The volume spike occurring immediately after or alongside the breakout label confirms that institutional participation is behind the move. A breakout without volume is frequently a trap — a breakout with a volume spike right after is significantly more likely to follow through.
スナップショット
How to enter:

  • []Wait for the breakout label to appear AND see the volume spike dot on the same or next 1–2 candles
    []Enter at market on the close of the volume spike candle, or on a small pullback into the broken level
    []Stop loss: just below the broken resistance (for longs) or just above the broken support (for shorts) — beyond the zone boundary
    []Target: next S/R zone visible on the chart, or a 1.5–2x ATR minimum

If BREAKOUT ▲/▼ shows "⚠ STRETCHED": This means price is already significantly extended from the EMA ribbon at the moment of the breakout. A volume spike dot within 1–2 candles still validates the move — but be aware that a pullback to the EMAs is likely before continuation. In this case, reduce position size or wait for the retest instead of chasing the initial breakout.
スナップショット
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🥈 RANK 2 — Retest Entry (High Quality, Lower Risk)
What it looks like: After a BREAKOUT label fires, price pulls back to the broken level within the retest window. A RETEST ▲ or RETEST ▼ label appears, and the confluence triangle signal fires.
Why it's strong: The retest is the classic institutional entry — the breakout already proved the level was breakable, and the pullback offers an optimal risk/reward entry with a nearby and well-defined stop.
スナップショット
How to enter:

  • []Wait for the RETEST label — do not anticipate it. Price must close back in the broken zone's range and show a reversal candle (engulfing or pin bar adds confidence)
    []Enter on the close of the confirming candle at the retest zone
    []Stop loss: a close back below the retest zone (not a wick — a full candle body close on the wrong side)
    []Target: the breakout high/low target or the next S/R zone

Highest conviction retest setup: RETEST label + confluence triangle + volume above average + RSI not at extreme = A or A+ grade signal. These are the setups to size up on.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🥉 RANK 3 — Trend Confluence Signal at S/R (Medium-High Quality)
What it looks like: Price reaches a confirmed support or resistance zone while the trend structure, EMA alignment, momentum, and ADX all agree. The confluence triangle fires without a preceding breakout — price is bouncing from the zone within an established trend.
Why it works: This is the classic trend continuation pullback entry — price returns to a key level inside an ongoing trend, and multiple independent factors confirm the bounce has begun.
スナップショット
How to enter:

  • []The UPTREND ▲ or DOWNTREND ▼ label must have already appeared — do not take confluence signals at S/R during a ranging market (no active trend label = lower confidence)
    []Wait for a confirming candle at the zone — a bullish engulfing, pin bar, or strong close in the trend direction adds significant weight
    []Enter on the close of the confirming candle
    []Stop loss: beyond the S/R zone boundary plus one ATR buffer
  • Target: the prior swing high/low, next resistance zone, or 2x ATR

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4 — Trend Structure Label Entry (Use With Additional Confirmation)
What it looks like: An UPTREND ▲ or DOWNTREND ▼ label appears, marking a confirmed shift in market structure (a new Higher High + Higher Low, or Lower High + Lower Low).
Important — do not enter directly on the label: The trend label confirms that structure has already shifted — it is not an entry signal by itself. Price has typically already moved significantly by the time the label fires, and entering immediately carries the risk of chasing an extended move.
How to use the trend label:

  • []Treat it as a directional bias reset — from this point forward, only look for long setups (after UPTREND ▲) or short setups (after DOWNTREND ▼)
    []Wait for the first confluence triangle signal that appears after the trend label — this is your primary entry in the new trend direction
    []Alternatively, wait for price to pull back to the nearest S/R zone or EMA and generate a confluence signal there
    []The closer the first post-label triangle is to an S/R zone and the 21 or 50 EMA, the higher the trade quality

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ The Stretched Breakout — When to Be Careful
When a breakout label shows "⚠ STRETCHED", it means the breakout is occurring while price is already significantly extended from the EMA ribbon — the gap between price and the Fast EMA, or between the Fast and Slow EMA, has reached a level where mean reversion risk is elevated.
Stretched breakout without volume spike → Stand aside or reduce size significantly. The move has likely already travelled the bulk of its range for this leg, and a snapback to the EMAs is the more probable next event.
Stretched breakout with volume spike within 1–2 candles → Momentum is genuine, but manage it differently:

  • []Do not chase — wait for a small pullback toward the broken level or the Fast EMA
    []Use a tighter stop and reduced position size
    []Take profit earlier than you normally would — the extended distance from EMAs means the move is borrowing from the next leg
    []Watch for RSI divergence forming quickly after the breakout — this is a sign the stretched move is exhausting

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Choppy / Ranging Markets — When NOT to Trade
AlphaX Edge has multiple visual signals that tell you to step aside:

  • []EMAs converging and flattening — when all three EMAs cluster together and move sideways, there is no directional bias. Signals in this environment are lower quality regardless of score.
    []No active trend label — if neither UPTREND ▲ nor DOWNTREND ▼ has appeared recently, the market is in a structural no-man's-land. Wait for structure to develop.
    []Dashboard shows WEAK TREND — STAND ASIDE or MIXED — STAND ASIDE — these verdict states indicate that ADX is below threshold or bull and bear scores are close. Both are warning signs.
    []Squeeze is ON (● SQUEEZE ON in dashboard) — do not enter during an active squeeze. Wait for the squeeze to fire (◆ SQUEEZE FIRED) and for a directional confluence signal to follow.
  • Rapid alternating UPTREND/DOWNTREND labels — if the trend structure labels are flipping frequently, the market is whipsawing. The cooldown filter reduces this, but the message is clear: no clean trend is present.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 The Dashboard — Reading Your Market State at a Glance
The real-time dashboard displays 12 live metrics organized into three sections:
Structure Section:

  • []Price Position — whether price is at support, resistance, breaking out, or retesting
    []Trend — current trend direction with active structure state (HH+HL, LH+LL, etc.)
    []EMA Trend — EMA ribbon alignment and price position relative to the 200 EMA
    []ADX — trend strength with numeric value
  • Squeeze — current squeeze state

Momentum Section:

  • []Momentum — oscillator vote count (how many of the three confirm each direction)
    []RSI — current RSI state (rising, falling, overbought, oversold) with numeric value
  • Rel Volume — current volume relative to the moving average (Dry / Normal / High / Spike)

Scoring Section:

  • []Bull Score — current confluence count out of 10 and confidence percentage with grade
    []Bear Score — same for bearish direction
    []Verdict — system's current market assessment (High Confidence Long/Short, Lean Long/Short, Mixed, Squeeze, Weak Trend)
    []Last Signal — direction, grade, confidence %, score, active factors, entry price, and bars since signal

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions

  • []Edge Long Signal — confluence triangle long entry fires
    []Edge Short Signal — confluence triangle short entry fires
    []Bullish Breakout — confirmed resistance breakout
    []Bearish Breakout — confirmed support breakdown
    []Bullish Retest — post-breakout bullish retest confirmed
    []Bearish Retest — post-breakout bearish retest confirmed
    []RSI Bull Divergence — bullish RSI divergence detected
    []RSI Bear Divergence — bearish RSI divergence detected

All alert messages include {{ticker}} and {{interval}} for clean webhook integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features

  • []🔬 Six-layer confluence engine — S/R, breakout, trend structure, EMA, momentum, squeeze must agree before a signal fires
    []🏷 Smart S/R zones — auto-merged, touch-confirmed, polarity-flipping, age-managed
    []⚠ Stretch filter — warns when breakouts occur at EMA-extended levels with visual label modification
    []🧠 10-factor confluence scoring with weighted confidence percentage and A+ to D grading
    []📊 Anti-fake breakout engine — body strength, volume, margin close, and RSI/ADX filter required
    []◆ Bollinger Squeeze integration — coiled volatility detection with directional momentum bias
    []📐 Three-EMA structural ribbon (21 / 50 / 200) with fan analysis
    []💎 RSI divergence detection with pivot-confirmed highs and lows
    []🕯 Candlestick pattern recognition — engulfing, pin bar, strong body candles
    []📋 Real-time 12-metric dashboard with live verdict and last signal tracker
    []🔔 8 alert conditions with ticker and interval placeholders
    []⚙ Fully configurable — all periods, thresholds, zone parameters, stretch filters, label sizes, and colors adjustable

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Support / Resistance

  • []S/R Swing Length — pivot detection sensitivity (default: 7)
    []Merge Zones Within (x ATR) — how close two levels must be to merge (default: 1.2)
    []Max Active Zones — maximum number of zones displayed simultaneously (default: 6)
    []Zone Max Age (bars) — bars before an untouched zone is removed (default: 250)
    []Min Touches to Confirm — touches required before a zone is considered confirmed (default: 2)
    []Show S/R Zones / Show S/R Level Lines — visibility toggles

Breakout Detection

  • []Show Breakout Labels — toggle breakout label display
    []Require Volume on Breakout — whether volume confirmation is required (default: on)
    []Breakout Volume Multiplier — volume threshold relative to average (default: 1.4x)
    []Breakout Cooldown (bars) — minimum bars between breakout labels (default: 10)
  • Show Retest Labels / Retest Window (bars) — retest detection controls

Trend Structure

  • []Trend Swing Length — pivot length for structure analysis (default: 12)
    []Show Trend Lines / Show Trend Shift Labels — visibility toggles
  • Trend Label Cooldown — minimum bars between trend labels (default: 18)

Momentum

  • []RSI Length (default: 14) — Show RSI Divergence toggle
    []ADX Length (default: 14) — ADX Trend Threshold (default: 22)

Volume
  • Volume MA Length (default: 20) — Show Volume Spike Dots toggle

Squeeze Filter

  • []Bollinger Band Length / Multiplier — BB parameters for squeeze detection
    []Keltner Channel Length / Multiplier — KC parameters for squeeze detection

EMA Settings
  • Fast / Medium / Slow EMA lengths (defaults: 21 / 50 / 200) with individual visibility toggles

Stretch Filter

  • []Stretch: Fast EMA Distance (x ATR) — how far price must be from Fast EMA to trigger stretch warning (default: 2.0)
    []Stretch: EMA Spread (x ATR) — how wide the EMA ribbon must be to trigger stretch warning (default: 3.0)

Confluence Engine

  • []Min Confluence Score — minimum out of 10 factors required for a signal (default: 4)
    []Show Entry Signals — toggle triangle signals
  • Signal Cooldown (bars) — minimum bars between entry signals (default: 12)

Display

  • []Show Dashboard — toggle dashboard visibility
    []Dashboard Position — Top Right / Top Left / Bottom Right / Bottom Left
    []Dashboard Text Size — Tiny / Small / Normal
    []Dashboard Background color
  • Label Size — controls size of all chart labels (Tiny / Small / Normal, default: Tiny)

Theme

  • []Bull Primary / Bright / Dim — yellow-green family for all bullish elements
    []Bear Primary / Bright / Dim — red family for all bearish elements
    []Support / Resistance / Untested Zone Colors
    []Neutral color for inactive states
  • Individual EMA colors

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Instrument

  • []XAUUSD 1m–5m — defaults work well. Increase ADX threshold to 25 on 5m for cleaner trend filter.
    []Forex Majors — reduce S/R Swing Length to 5, reduce Breakout Volume Multiplier to 1.2
    []Indices (NAS100, US30) — increase Trend Swing Length to 15–18, increase Min Confluence to 5
    []Higher Timeframes (1H+) — increase all swing lengths by 30–50%, increase signal cooldowns
    []More signals — reduce Min Confluence Score to 3, reduce ADX threshold to 18
    []Cleaner signals — increase Min Confluence Score to 5–6, enable volume requirement

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For

  • []🥇 Breakout traders — the anti-fake breakout engine with volume, body strength, and RSI/ADX filters is built specifically to eliminate the false breakouts that destroy breakout strategies
    []📉 Pullback and retest traders — the retest detection system with polarity-flipping zones provides textbook entries at confirmed levels
    []📊 Trend followers — trend structure analysis with EMA ribbon and ADX ensures signals only fire in genuine trending conditions
    []🧠 Systematic traders — the 10-factor scoring and confidence grading give a quantitative framework, not just colored arrows
    []📈 Traders who want clean charts — everything is on one indicator with a consistent visual language. No indicator soup.
    []⚠ Traders who struggle with overtrading — the confluence requirements, ADX filter, squeeze gate, and cooldown timers physically prevent low-quality signals from appearing

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes

  • []All signals are confirmed on bar close — no repainting
    []S/R zones use extend.right — they project forward until broken or aged out
    []The squeeze engine compares Bollinger Bands against Keltner Channels on every bar — no external squeeze indicator required
    []RSI divergence uses confirmed pivot highs and lows with a minimum separation requirement — single-bar spikes do not qualify
    []Maximum 500 labels, boxes, and lines are used — on very low timeframes with extended history, oldest drawings may be removed by TradingView's rendering limits
    []The confidence percentage and grade are recalculated on every bar in real time — the dashboard always reflects the current bar's conditions

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ 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 need more than arrows — a full analytical system that thinks before it signals.
リリースノート
Default settings Tuned for XAUUSD 1 MIN
リリースノート
v[x] — S/R Zone Visibility Fix

Removed excessive hardcoded transparency from all Support/Resistance zone boxes and lines
Border colors now render at full opacity (user-chosen color, no forced dimming)
Zone fill opacity reduced from ~92–94% transparent to 75% — still readable as a zone without obscuring price action
Lines now render at full opacity instead of 45–60% transparent
Users can now fine-tune colors and opacity directly from TradingView's indicator settings as expected

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。