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
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.