Intermarket Correlation Oscillator (ICO)The Intermarket Correlation Oscillator (ICO) is a TradingView indicator that helps traders analyze the relationship between two assets, such as stocks, indices, or cryptocurrencies, by measuring their price correlation. It displays this correlation as an oscillator ranging from -1 to +1, making it easy to spot whether the assets move together, oppositely, or independently. A value near +1 indicates strong positive correlation (assets move in the same direction), near -1 shows strong negative correlation (opposite movements), and near 0 suggests no correlation. This tool is ideal for confirming trends, spotting divergences, or identifying hedging opportunities across markets.
How It Works?
The ICO calculates the Pearson correlation coefficient between the chart’s primary asset (e.g., Apple stock) and a secondary asset you choose (e.g., SPY for the S&P 500) over a specified number of bars (default: 20). The oscillator is plotted in a separate pane below the chart, with key levels at +0.8 (overbought, strong positive correlation) and -0.8 (oversold, strong negative correlation). A midline at 0 helps gauge neutral correlation. When the oscillator crosses these levels or the midline, labels ("OB" for overbought, "OS" for oversold) and alerts notify you of significant shifts. Shaded zones highlight extreme correlations (red for overbought, green for oversold) if enabled.
Why Use the ICO?
Trend Confirmation: High positive correlation (e.g., SPY and QQQ both rising) confirms market trends.
Divergence Detection: Negative correlation (e.g., DXY rising while stocks fall) signals potential reversals.
Hedging: Identify negatively correlated assets to balance your portfolio.
Market Insights: Understand how assets like stocks, bonds, or crypto interact.
Easy Steps to Use the ICO in TradingView
Add the Indicator:
Open TradingView and load your chart (e.g., AAPL on a daily timeframe).
Go to the Pine Editor at the bottom of the TradingView window.
Copy and paste the ICO script provided earlier.
Click "Add to Chart" to display the oscillator below your price chart.
Configure Settings:
Click the gear icon next to the indicator’s name in the chart pane to open settings.
Secondary Symbol: Choose an asset to compare with your chart’s symbol (e.g., "SPY" for S&P 500, "DXY" for USD Index, or "BTCUSD" for Bitcoin). Default is SPY.
Correlation Lookback Period: Set the number of bars for calculation (default: 20). Use 10-14 for short-term trading or 50 for longer-term analysis.
Overbought/Oversold Levels: Adjust thresholds (default: +0.8 for overbought, -0.8 for oversold) to suit your strategy. Lower values (e.g., ±0.7) give more signals.
Show Midline/Zones: Check boxes to display the zero line and shaded overbought/oversold zones for visual clarity.
Interpret the Oscillator:
Above +0.8: Strong positive correlation (red zone). Assets move together.
Below -0.8: Strong negative correlation (green zone). Assets move oppositely.
Near 0: No clear relationship (midline reference).
Labels: "OB" or "OS" appears when crossing overbought/oversold levels, signaling potential correlation shifts.
Set Up Alerts:
Right-click the indicator, select "Add Alert."
Choose conditions like "Overbought Alert" (crossing above +0.8), "Oversold Alert" (crossing below -0.8), or zero-line crossings for bullish/bearish correlation shifts.
Configure notifications (e.g., email, SMS) to stay informed.
Apply to Trading:
Use positive correlation to confirm trades (e.g., buy AAPL if SPY is rising and correlation is high).
Spot divergences for reversals (e.g., stocks dropping while DXY rises with negative correlation).
Combine with other indicators like RSI or moving averages for stronger signals.
Tips for New Users
Start with related assets (e.g., SPY and QQQ for tech stocks) to see clear correlations.
Test on a demo account to understand signals before trading live.
Be aware that correlation is a lagging indicator; confirm signals with price action.
If the secondary symbol doesn’t load, ensure it’s valid on TradingView (e.g., use correct ticker format).
The ICO is a powerful, beginner-friendly tool to explore intermarket relationships, enhancing your trading decisions with clear visual cues and alerts.
Intermarketanalysis
Intermarket Correlation TableThe Correlation Coefficient is used to measure the correlation between two sets of data. In the trading world, the Correlation Coefficient is a measure of the correlation between two data sets of financial instruments. The correlation between two financial instruments is the degree in which they are related. Correlation is based on a scale of 1 to -1. The closer the Correlation Coefficient is to 1, the higher their positive correlation. The instruments will move up and down together. The closer the Correlation coefficient is to -1, the more they move in opposite directions. A value at 0 indicates that there is no correlation.
This indicator uses the built in ta.correlation function to calculate the correlation coefficient between DXY and NQ, ES, YM, US10Y, and ZN respectively. It then presents the data in a customizable table that is view as an overlay on your chart.
Adjust the length of the correlation factor to calculate higher time frame correlation.
Asset background changes based on current candle direction.
Coefficient background color changes based on whether the assets are properly correlated.
DXY is inversely correlated to NQ, ES, YM, and ZN.
DXY is directly correlated to US10Y.
The colors are reflected as such.
Strength Comparison @joshuuuexample:
if you want to find the stronger/weaker pair between eurusd and gbpusd, what you can do is check the eurgbp charts. if eurgbp is bullish, that means, that longs longs on eurusd are better than on gbpusd.
Unfortunately, there is no such thing to compare for example usoil with ukoil, or us100 with us500.
That's where this indicator comes in handy. You can choose whatever two symbols you want, that are supported by tradingview and you will get a chart, which shows symbol1/symbol2.
Now you can use normal market structure, or the ema option, to find out the stronger symbol.
This can also help predicting the so called SMT Divergences, taught by ICT.
⚠️ Open Source ⚠️
Coders and TV users are authorized to copy this code base, but a paid distribution is prohibited. A mention to the original author is expected, and appreciated.
⚠️ Terms and Conditions ⚠️
This financial tool is for educational purposes only and not financial advice. Users assume responsibility for decisions made based on the tool's information. Past performance doesn't guarantee future results. By using this tool, users agree to these terms.