OPEN-SOURCE SCRIPT
Xander Scalping Strategy [Price Action + Confirmation]

🚀 Xander Scalping Strategy [Price Action + Confirmation]
by wijayanto_ok
A multi-confirmation scalping strategy combining trend filtering, dynamic support/resistance, Stochastic RSI momentum, and volume confirmation — with visual Risk/Reward estimation for disciplined trading.
================================================================================
📌 OVERVIEW
================================================================================
Xander Scalping Strategy is a Price Action-based trading tool designed for traders who prioritize high-probability, multi-layer confirmation before entry. It helps identify:
✅ Trend Direction using EMA 13/21 crossover
✅ Dynamic Support & Resistance from confirmed swing highs/lows
✅ Precision Entry Signals via Stochastic RSI + Volume spike confirmation
✅ Visual Risk/Reward Estimator for smarter position management
🎯 Best For: Timeframes 5m – 1H | Liquid assets (Forex majors, BTC/ETH, Indices)
================================================================================
✨ KEY FEATURES
================================================================================
🔹 1. Trend Filter (EMA 13/21)
---------------------------------
• Fast EMA (13) & Slow EMA (21) with dynamic coloring:
🟢 Green = Uptrend | 🔴 Red = Downtrend | ⚪ Gray = Sideways
• Real-time trend label in top-right corner for quick reference
🔹 2. Dynamic Support & Resistance
---------------------------------
• Auto-detects Swing High/Low using ta.pivothigh() / ta.pivotlow()
• Horizontal S/R lines extended to the right (real-time visualization)
• Updates automatically when new swings are confirmed
⚠️ Note: 1-candle lag for pivot confirmation = non-repainting logic
🔹 3. Multi-Layer Entry Confirmation
---------------------------------
Component | Settings | Purpose
-------------------|---------------------------------------|---------------------------
Stochastic RSI | RSI Len: 14, %K: 3, %D: 3, OB: 80, OS: 20 | Momentum timing & reversal signals
Volume Filter | Avg Volume (20-period) | Filters low-liquidity false signals
Price Action | Pullback to EMA zone OR bounce/reject at S/R | Confirms structural alignment
✅ BUY Signal Conditions:
1. Uptrend (EMA 13 > EMA 21)
2. Price pulls back to EMA zone OR bounces from Support
3. StochRSI crosses UP from Oversold (<20)
4. Volume > 20-period average
→ Green "BUY" arrow appears below candle
✅ SELL Signal Conditions:
1. Downtrend (EMA 13 < EMA 21)
2. Price pulls back to EMA zone OR rejects from Resistance
3. StochRSI crosses DOWN from Overbought (>80)
4. Volume > 20-period average
→ Red "SELL" arrow appears above candle
🔹 4. Visual Risk/Reward Table (Top-Right)
---------------------------------
Metric | Description
----------|--------------------------------------------------
Status | Current trend or active signal (LONG/SHORT/UPTREND/DOWNTREND)
Est. RR | Estimated Risk:Reward ratio based on latest swing levels
💡 Tip: Use RR ≥ 1:1.5 as an additional filter for higher-quality entries.
🔹 5. Alert System
---------------------------------
• 🔔 "Xander Buy Signal" — Triggered when all BUY conditions met
• 🔔 "Xander Sell Signal" — Triggered when all SELL conditions met
• Compatible with TradingView alerts (popup, email, webhook, SMS)
================================================================================
⚙️ HOW TO USE
================================================================================
🔧 Setup:
1. Apply script to chart with timeframe 5m, 15m, or 1H
2. Recommended assets:
• Forex: EURUSD, GBPUSD, USDJPY
• Crypto: BTCUSDT, ETHUSDT
• Indices: US30, NAS100, SPX500
🎯 LONG Entry Setup:
1. Confirm "UPTREND 🟢" label is visible
2. Wait for pullback to EMA 13-21 zone OR bounce from green Support line
3. Confirm: Green BUY arrow appears + candle closes bullish
4. StochRSI: Crosses up from <20 zone
5. Volume: Bar higher than 20-period average
📍 Stop Loss: Below nearest lastSwingLow
🎯 Take Profit: Nearest lastSwingHigh OR RR target ≥1:1.5
🎯 SHORT Entry Setup:
1. Confirm "DOWNTREND 🔴" label is visible
2. Wait for pullback to EMA 13-21 zone OR rejection from red Resistance line
3. Confirm: Red SELL arrow appears + candle closes bearish
4. StochRSI: Crosses down from >80 zone
5. Volume: Bar higher than 20-period average
📍 Stop Loss: Above nearest lastSwingHigh
🎯 Take Profit: Nearest lastSwingLow OR RR target ≥1:1.5
⚠️ Recommended Filters:
❌ Avoid trading when label shows "SIDEWAYS ⚪"
❌ Skip signals with Est. RR < 1:1
❌ Avoid entries 5 min before/after high-impact news events
✅ Always confirm with candlestick patterns (pinbar, engulfing, etc.)
================================================================================
🔍 TECHNICAL NOTES (Advanced Users)
================================================================================
📐 Pivot Detection (Non-Repainting):
ph = ta.pivothigh(high, lookbackPeriod, lookbackPeriod)
pl = ta.pivotlow(low, lookbackPeriod, lookbackPeriod)
• Requires rightBars = lookbackPeriod for confirmation → NO REPAINTING
• New swing confirmed only after N candles close to the right
• Recommended: lookbackPeriod = 50 for significant swings; 20-30 for responsive signals
📊 Stochastic RSI Calculation:
rsiSource = ta.rsi(close, 14)
stoch = (rsiSource - lowestRSI) / (highestRSI - lowestRSI) * 100
%K = ta.sma(stoch, 3), %D = ta.sma(%K, 3)
• Measures relative momentum within 0–100 range
• Crosses at extremes (20/80) offer high-probability reversal signals
📈 Risk/Reward Estimation:
// For BUY:
risk = close - lastSwingLow
reward = lastSwingHigh - close
RR = reward / risk
• Uses latest confirmed swing levels as reference for SL/TP
⚠️ Estimates only — always adjust to real-time market structure
================================================================================
⚠️ DISCLAIMER & RISK WARNING
================================================================================
🚨 IMPORTANT: This script is an analytical tool only. It does NOT guarantee profits or replace sound trading judgment.
1. Backtest First: Test in demo mode for 2–4 weeks before live trading.
2. No Holy Grail: No strategy wins 100%. Manage expectations and use strict money management.
3. Market Conditions: Performs best in trending markets. May underperform in extreme sideways or news-driven volatility.
4. Non-Repainting: Signals appear only after candle close and pivot confirmation. Minor 1-candle lag on swing detection is intentional for reliability.
5. Always Use Stop Loss: Never trade without predefined risk protection.
🔹 Trading forex, crypto, and derivatives carries substantial risk of loss. Trade only with capital you can afford to lose.
================================================================================
🔄 VERSION HISTORY
================================================================================
Version | Date | Changes
--------|------------|--------------------------------------------------
1.0 | May 2026 | Initial release: EMA + S/R + StochRSI + Volume + RR Table
================================================================================
💬 FEEDBACK & SUPPORT
================================================================================
• 🛠 Found a bug? Report with screenshot + timeframe + asset for faster resolution.
• 💡 Have an improvement idea? Comment below or DM @wijayanto_ok.
• 🌟 Enjoying the script? A like/follow helps support future updates!
"Plan your trade, trade your plan. Consistency > Perfection."
— Xander Scalping Philosophy
================================================================================
🔖 TAGS (For Search Optimization)
================================================================================
scalping, price-action, ema, support-resistance, stochastic-rsi, volume, risk-reward, swing-trading, confirmation, non-repainting, tradingview, pine-script
================================================================================
✅ PRE-PUBLISH CHECKLIST
================================================================================
[x] Tested on 3+ assets & timeframes
[x] All inputs have sensible defaults
[x] Code is well-commented & structured
[x] Risk disclaimer included
[x] Alert conditions defined
[x] No unwanted repainting logic
[x] Documentation complete & professional
================================================================================
🙏 Thank you for using Xander Scalping Strategy!
Happy trading, and may your RR always be in your favor. 🎯📈
================================================================================
by wijayanto_ok
A multi-confirmation scalping strategy combining trend filtering, dynamic support/resistance, Stochastic RSI momentum, and volume confirmation — with visual Risk/Reward estimation for disciplined trading.
================================================================================
📌 OVERVIEW
================================================================================
Xander Scalping Strategy is a Price Action-based trading tool designed for traders who prioritize high-probability, multi-layer confirmation before entry. It helps identify:
✅ Trend Direction using EMA 13/21 crossover
✅ Dynamic Support & Resistance from confirmed swing highs/lows
✅ Precision Entry Signals via Stochastic RSI + Volume spike confirmation
✅ Visual Risk/Reward Estimator for smarter position management
🎯 Best For: Timeframes 5m – 1H | Liquid assets (Forex majors, BTC/ETH, Indices)
================================================================================
✨ KEY FEATURES
================================================================================
🔹 1. Trend Filter (EMA 13/21)
---------------------------------
• Fast EMA (13) & Slow EMA (21) with dynamic coloring:
🟢 Green = Uptrend | 🔴 Red = Downtrend | ⚪ Gray = Sideways
• Real-time trend label in top-right corner for quick reference
🔹 2. Dynamic Support & Resistance
---------------------------------
• Auto-detects Swing High/Low using ta.pivothigh() / ta.pivotlow()
• Horizontal S/R lines extended to the right (real-time visualization)
• Updates automatically when new swings are confirmed
⚠️ Note: 1-candle lag for pivot confirmation = non-repainting logic
🔹 3. Multi-Layer Entry Confirmation
---------------------------------
Component | Settings | Purpose
-------------------|---------------------------------------|---------------------------
Stochastic RSI | RSI Len: 14, %K: 3, %D: 3, OB: 80, OS: 20 | Momentum timing & reversal signals
Volume Filter | Avg Volume (20-period) | Filters low-liquidity false signals
Price Action | Pullback to EMA zone OR bounce/reject at S/R | Confirms structural alignment
✅ BUY Signal Conditions:
1. Uptrend (EMA 13 > EMA 21)
2. Price pulls back to EMA zone OR bounces from Support
3. StochRSI crosses UP from Oversold (<20)
4. Volume > 20-period average
→ Green "BUY" arrow appears below candle
✅ SELL Signal Conditions:
1. Downtrend (EMA 13 < EMA 21)
2. Price pulls back to EMA zone OR rejects from Resistance
3. StochRSI crosses DOWN from Overbought (>80)
4. Volume > 20-period average
→ Red "SELL" arrow appears above candle
🔹 4. Visual Risk/Reward Table (Top-Right)
---------------------------------
Metric | Description
----------|--------------------------------------------------
Status | Current trend or active signal (LONG/SHORT/UPTREND/DOWNTREND)
Est. RR | Estimated Risk:Reward ratio based on latest swing levels
💡 Tip: Use RR ≥ 1:1.5 as an additional filter for higher-quality entries.
🔹 5. Alert System
---------------------------------
• 🔔 "Xander Buy Signal" — Triggered when all BUY conditions met
• 🔔 "Xander Sell Signal" — Triggered when all SELL conditions met
• Compatible with TradingView alerts (popup, email, webhook, SMS)
================================================================================
⚙️ HOW TO USE
================================================================================
🔧 Setup:
1. Apply script to chart with timeframe 5m, 15m, or 1H
2. Recommended assets:
• Forex: EURUSD, GBPUSD, USDJPY
• Crypto: BTCUSDT, ETHUSDT
• Indices: US30, NAS100, SPX500
🎯 LONG Entry Setup:
1. Confirm "UPTREND 🟢" label is visible
2. Wait for pullback to EMA 13-21 zone OR bounce from green Support line
3. Confirm: Green BUY arrow appears + candle closes bullish
4. StochRSI: Crosses up from <20 zone
5. Volume: Bar higher than 20-period average
📍 Stop Loss: Below nearest lastSwingLow
🎯 Take Profit: Nearest lastSwingHigh OR RR target ≥1:1.5
🎯 SHORT Entry Setup:
1. Confirm "DOWNTREND 🔴" label is visible
2. Wait for pullback to EMA 13-21 zone OR rejection from red Resistance line
3. Confirm: Red SELL arrow appears + candle closes bearish
4. StochRSI: Crosses down from >80 zone
5. Volume: Bar higher than 20-period average
📍 Stop Loss: Above nearest lastSwingHigh
🎯 Take Profit: Nearest lastSwingLow OR RR target ≥1:1.5
⚠️ Recommended Filters:
❌ Avoid trading when label shows "SIDEWAYS ⚪"
❌ Skip signals with Est. RR < 1:1
❌ Avoid entries 5 min before/after high-impact news events
✅ Always confirm with candlestick patterns (pinbar, engulfing, etc.)
================================================================================
🔍 TECHNICAL NOTES (Advanced Users)
================================================================================
📐 Pivot Detection (Non-Repainting):
ph = ta.pivothigh(high, lookbackPeriod, lookbackPeriod)
pl = ta.pivotlow(low, lookbackPeriod, lookbackPeriod)
• Requires rightBars = lookbackPeriod for confirmation → NO REPAINTING
• New swing confirmed only after N candles close to the right
• Recommended: lookbackPeriod = 50 for significant swings; 20-30 for responsive signals
📊 Stochastic RSI Calculation:
rsiSource = ta.rsi(close, 14)
stoch = (rsiSource - lowestRSI) / (highestRSI - lowestRSI) * 100
%K = ta.sma(stoch, 3), %D = ta.sma(%K, 3)
• Measures relative momentum within 0–100 range
• Crosses at extremes (20/80) offer high-probability reversal signals
📈 Risk/Reward Estimation:
// For BUY:
risk = close - lastSwingLow
reward = lastSwingHigh - close
RR = reward / risk
• Uses latest confirmed swing levels as reference for SL/TP
⚠️ Estimates only — always adjust to real-time market structure
================================================================================
⚠️ DISCLAIMER & RISK WARNING
================================================================================
🚨 IMPORTANT: This script is an analytical tool only. It does NOT guarantee profits or replace sound trading judgment.
1. Backtest First: Test in demo mode for 2–4 weeks before live trading.
2. No Holy Grail: No strategy wins 100%. Manage expectations and use strict money management.
3. Market Conditions: Performs best in trending markets. May underperform in extreme sideways or news-driven volatility.
4. Non-Repainting: Signals appear only after candle close and pivot confirmation. Minor 1-candle lag on swing detection is intentional for reliability.
5. Always Use Stop Loss: Never trade without predefined risk protection.
🔹 Trading forex, crypto, and derivatives carries substantial risk of loss. Trade only with capital you can afford to lose.
================================================================================
🔄 VERSION HISTORY
================================================================================
Version | Date | Changes
--------|------------|--------------------------------------------------
1.0 | May 2026 | Initial release: EMA + S/R + StochRSI + Volume + RR Table
================================================================================
💬 FEEDBACK & SUPPORT
================================================================================
• 🛠 Found a bug? Report with screenshot + timeframe + asset for faster resolution.
• 💡 Have an improvement idea? Comment below or DM @wijayanto_ok.
• 🌟 Enjoying the script? A like/follow helps support future updates!
"Plan your trade, trade your plan. Consistency > Perfection."
— Xander Scalping Philosophy
================================================================================
🔖 TAGS (For Search Optimization)
================================================================================
scalping, price-action, ema, support-resistance, stochastic-rsi, volume, risk-reward, swing-trading, confirmation, non-repainting, tradingview, pine-script
================================================================================
✅ PRE-PUBLISH CHECKLIST
================================================================================
[x] Tested on 3+ assets & timeframes
[x] All inputs have sensible defaults
[x] Code is well-commented & structured
[x] Risk disclaimer included
[x] Alert conditions defined
[x] No unwanted repainting logic
[x] Documentation complete & professional
================================================================================
🙏 Thank you for using Xander Scalping Strategy!
Happy trading, and may your RR always be in your favor. 🎯📈
================================================================================
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.