PROTECTED SOURCE SCRIPT
Telah dikemas kini Z-Score Pairs Trading

Title: Z-Score Pairs Trading Indicator
Description:
This indicator implements a Z-score based pairs trading strategy, allowing traders to identify potential statistical arbitrage opportunities between two selected assets.
Key Features:
- Calculates Z-score for the price difference between any two user-selected symbols
- Visualizes Z-score with customizable thresholds for signals
- Generates long and short signals based on extreme Z-score values
- Adaptable to various markets including stocks, ETFs, and commodities
How It Works:
1. The indicator calculates the price difference between two selected symbols.
2. It then computes the Z-score of this difference, showing how far the current spread deviates from its historical average.
3. When the Z-score exceeds set thresholds (default ±2), the indicator generates trading signals.
Settings:
- Symbol A and Symbol B: Select any two tradable symbols to compare
- Lookback Period: Number of periods for calculating the moving average and standard deviation
Interpretation:
- Z-score above 2: Potential short signal (pair is likely overextended)
- Z-score below -2: Potential long signal (pair is likely oversold)
- Z-score between -2 and 2: Normal trading range, no signals
Visual Aids:
- Blue line: Z-score
- Dashed lines: Threshold levels at 0, ±1, and ±2
- Green triangles: Long signals
- Red triangles: Short signals
Disclaimer:
This indicator is for educational and research purposes only. Trading carries a high level of risk. Always conduct your own analysis and manage your risk appropriately before entering any trade.
Made by @marekfleisi
Description:
This indicator implements a Z-score based pairs trading strategy, allowing traders to identify potential statistical arbitrage opportunities between two selected assets.
Key Features:
- Calculates Z-score for the price difference between any two user-selected symbols
- Visualizes Z-score with customizable thresholds for signals
- Generates long and short signals based on extreme Z-score values
- Adaptable to various markets including stocks, ETFs, and commodities
How It Works:
1. The indicator calculates the price difference between two selected symbols.
2. It then computes the Z-score of this difference, showing how far the current spread deviates from its historical average.
3. When the Z-score exceeds set thresholds (default ±2), the indicator generates trading signals.
Settings:
- Symbol A and Symbol B: Select any two tradable symbols to compare
- Lookback Period: Number of periods for calculating the moving average and standard deviation
Interpretation:
- Z-score above 2: Potential short signal (pair is likely overextended)
- Z-score below -2: Potential long signal (pair is likely oversold)
- Z-score between -2 and 2: Normal trading range, no signals
Visual Aids:
- Blue line: Z-score
- Dashed lines: Threshold levels at 0, ±1, and ±2
- Green triangles: Long signals
- Red triangles: Short signals
Disclaimer:
This indicator is for educational and research purposes only. Trading carries a high level of risk. Always conduct your own analysis and manage your risk appropriately before entering any trade.
Made by @marekfleisi
Nota Keluaran
Dual Z-Score Pairs Trading IndicatorA statistical arbitrage strategy using dual timeframe Z-scores to identify trading opportunities between highly correlated pairs, optimized for crypto markets like BTC/USDT vs ETH/USDT.
Key Features:
• Dual Z-score calculation (1900/500 periods)
• Real-time correlation monitoring
• Clear visual trading signals
• Statistical arbitrage approach
• Perfect for crypto pairs
How It Works:
1. Long-term Z-score (1900 periods): Captures major trends
2. Short-term Z-score (500 periods): Captures immediate opportunities
Trading Signals:
When both Z-scores below -2:
• LONG first pair (e.g., BTC/USDT)
• SHORT second pair (e.g., ETH/USDT)
When both Z-scores above +2:
• SHORT first pair (e.g., BTC/USDT)
• LONG second pair (e.g., ETH/USDT)
Position Scaling:
• Initial entry: Z-score ±2 (30% size)
• First scale: Z-score ±3 (30% more)
• Second scale: Z-score ±4 (40% more)
Higher Z-scores indicate stronger mean reversion probability.
Visual Guide:
• Blue line: Long-term Z-score
• Orange line: Short-term Z-score
• Red/Green lines: ±2 thresholds
• Gray fill: Z-score difference
• Green/Red triangles: Entry signals
Trading Rules:
1. Wait for ±2 threshold cross
2. Check correlation (>0.8)
3. Enter both positions
4. Exit at Z-score zero cross
5. Stop if correlation drops
Requirements:
• Correlation above 0.8
• Good market liquidity
• Stable market conditions
Risk Management:
• Trade both pairs always
• Use 1-2x leverage max
• Equal position sizing
• Exit at zero cross
• Stop at correlation break
Setup Example:
Symbol A: BTC/USDT
Symbol B: ETH/USDT
Long Period: 1900
Short Period: 500
Threshold: ±2.0
Quick Start:
1. Find correlated pair
2. Wait for ±2 threshold
3. Enter 30% position
4. Scale at ±3 and ±4
5. Exit at zero cross
Disclaimer:
Educational purposes only. Trading carries significant risks.
Made by @marekfleisi
#arbitrage #correlation #pairstrading #zscore #crypto #bitcoin #ethereum #trading #quant #meanreversion
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.