PROTECTED SOURCE SCRIPT
BTC/SOL Spread Strategy

Spread Percentage Trading Strategy
A mean reversion strategy for highly correlated asset pairs (e.g., BTC/SOL) that trades based on price ratio divergence.
CORE CONCEPT
This strategy monitors the logarithmic spread between two correlated assets and generates trading signals when the spread deviates significantly from its historical mean. It only trades the second asset (S2) while using the first asset (S1) as a reference for spread calculation.
HOW IT WORKS
Spread Calculation:
- Computes log spread: log(S1) - log(S2)
- Calculates rolling Z-score of the spread
- Identifies overbought/oversold conditions
Entry Signals:
- Long S2: When spread Z-score crosses above entry threshold (S1 relatively overpriced)
- Short S2: When spread Z-score crosses below negative entry threshold (S2 relatively overpriced)
Exit Signals:
- Positions close when Z-score reverts to exit threshold levels
KEY PARAMETERS
- Window: Rolling period for mean and standard deviation calculation (default: 144)
- Entry Threshold: Z-score level to trigger new positions (default: 1.5)
- Exit Threshold: Z-score level to close positions (default: 0.3)
FEATURES
✓ Vectorized backtesting engine
✓ Built-in parameter optimization
✓ Comprehensive performance metrics
✓ Visual analysis tools
✓ Position sizing with leverage support
RISK WARNING
This strategy:
- Assumes mean-reverting behavior in price ratios
- Does not guarantee future performance
- Uses leverage which amplifies both gains and losses
- Does not include transaction costs in base implementation
- Requires monitoring of correlation breakdown
RECOMMENDED USE
Best suited for pairs with:
- High historical correlation (>0.8)
- Similar market dynamics
- Sufficient liquidity
- Stable volatility patterns
Always backtest with realistic transaction costs and implement proper risk management including stop-losses and position limits.
DISCLAIMER
For educational purposes only. Past performance does not guarantee future results. Trade at your
A mean reversion strategy for highly correlated asset pairs (e.g., BTC/SOL) that trades based on price ratio divergence.
CORE CONCEPT
This strategy monitors the logarithmic spread between two correlated assets and generates trading signals when the spread deviates significantly from its historical mean. It only trades the second asset (S2) while using the first asset (S1) as a reference for spread calculation.
HOW IT WORKS
Spread Calculation:
- Computes log spread: log(S1) - log(S2)
- Calculates rolling Z-score of the spread
- Identifies overbought/oversold conditions
Entry Signals:
- Long S2: When spread Z-score crosses above entry threshold (S1 relatively overpriced)
- Short S2: When spread Z-score crosses below negative entry threshold (S2 relatively overpriced)
Exit Signals:
- Positions close when Z-score reverts to exit threshold levels
KEY PARAMETERS
- Window: Rolling period for mean and standard deviation calculation (default: 144)
- Entry Threshold: Z-score level to trigger new positions (default: 1.5)
- Exit Threshold: Z-score level to close positions (default: 0.3)
FEATURES
✓ Vectorized backtesting engine
✓ Built-in parameter optimization
✓ Comprehensive performance metrics
✓ Visual analysis tools
✓ Position sizing with leverage support
RISK WARNING
This strategy:
- Assumes mean-reverting behavior in price ratios
- Does not guarantee future performance
- Uses leverage which amplifies both gains and losses
- Does not include transaction costs in base implementation
- Requires monitoring of correlation breakdown
RECOMMENDED USE
Best suited for pairs with:
- High historical correlation (>0.8)
- Similar market dynamics
- Sufficient liquidity
- Stable volatility patterns
Always backtest with realistic transaction costs and implement proper risk management including stop-losses and position limits.
DISCLAIMER
For educational purposes only. Past performance does not guarantee future results. Trade at your
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.