OPEN-SOURCE SCRIPT
Alpha Spread Indicator Chart - [AlphaGroup.Live]

Alpha Spread Indicator Chart – [AlphaGroup.Live]
This overlay plots the two legs of a pair trade directly on the price chart.
• Leg1 is shown in teal
• Leg2 (fitted) is shown in orange
• The green/red filled area shows the distance (spread) between the two
The spread is calculated using OLS regression fitting, which keeps Leg2 scaled to Leg1 so the overlay always sticks to the chart’s price axis. When the fill turns green, the model suggests Buy Leg1 / Sell Leg2; when it turns red, it suggests Sell Leg1 / Buy Leg2.
Optional Z-Score bands help visualize statistical stretch from the mean.
⚠️ Important: To use this tool properly, you also need to install the companion script:
👉 Alpha Spread Indicator Panel – [AlphaGroup.Live]
Pre-selected asset pairs included:
EURUSD / GBPUSD
AUDUSD / NZDUSD
USDJPY / USDCHF
USDCAD / USDNOK
EURJPY / GBPJPY
AUDJPY / NZDJPY
XAUUSD / XAGUSD
WTI (USOIL) / Brent (UKOIL)
NatGas / Crude
HeatingOil / RBOB
Corn / Wheat
Platinum / Palladium
XOM / CVX
KO / PEP
V / MA
JPM / BAC
NVDA / AMD
BHP / RIO
SHEL / BP
SPY / QQQ
Ready to take your trading further? Download our free eBook with 100 trading strategies at:
alphagroup.live/100-trading-strategies
Tags: pairs-trading, spread-trading, statistical-arbitrage, ols-regression, zscore, mean-reversion, arbitrage, quant, hedge, alphagroup
This overlay plots the two legs of a pair trade directly on the price chart.
• Leg1 is shown in teal
• Leg2 (fitted) is shown in orange
• The green/red filled area shows the distance (spread) between the two
The spread is calculated using OLS regression fitting, which keeps Leg2 scaled to Leg1 so the overlay always sticks to the chart’s price axis. When the fill turns green, the model suggests Buy Leg1 / Sell Leg2; when it turns red, it suggests Sell Leg1 / Buy Leg2.
Optional Z-Score bands help visualize statistical stretch from the mean.
⚠️ Important: To use this tool properly, you also need to install the companion script:
👉 Alpha Spread Indicator Panel – [AlphaGroup.Live]
Pre-selected asset pairs included:
EURUSD / GBPUSD
AUDUSD / NZDUSD
USDJPY / USDCHF
USDCAD / USDNOK
EURJPY / GBPJPY
AUDJPY / NZDJPY
XAUUSD / XAGUSD
WTI (USOIL) / Brent (UKOIL)
NatGas / Crude
HeatingOil / RBOB
Corn / Wheat
Platinum / Palladium
XOM / CVX
KO / PEP
V / MA
JPM / BAC
NVDA / AMD
BHP / RIO
SHEL / BP
SPY / QQQ
Ready to take your trading further? Download our free eBook with 100 trading strategies at:
alphagroup.live/100-trading-strategies
Tags: pairs-trading, spread-trading, statistical-arbitrage, ols-regression, zscore, mean-reversion, arbitrage, quant, hedge, alphagroup
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.