Omega Correlation [OmegaTools]Omega Correlation (Ω CRR) is a cross-asset analytics tool designed to quantify both the strength of the relationship between two instruments and the tendency of one to move ahead of the other. It is intended for traders who work with indices, futures, FX, commodities, equities and ETFs, and who require something more robust than a simple linear correlation line.
The indicator operates in two distinct modes, selected via the “Show” parameter: Correlation and Anticipation. In Correlation mode, the script focuses on how tightly the current chart and the chosen second asset move together. In Anticipation mode, it shifts to a lead–lag perspective and estimates whether the second asset tends to behave as a leader or a follower relative to the symbol on the chart.
In both modes, the core inputs are the chart symbol and a user-selected second symbol. Internally, both assets are transformed into normalized log-returns: the script computes logarithmic returns, removes short-term mean and scales by realized volatility, then clips extreme values. This normalisation allows the tool to compare behaviour across assets with different price levels and volatility profiles.
In Correlation mode, the indicator computes a composite correlation score that typically ranges between –1 and +1. Values near +1 indicate strong and persistent positive co-movement, values near zero indicate an unstable or weak link, and values near –1 indicate a stable anti-correlation regime. The composite score is constructed from three components.
The first component is a normalized return co-movement measure. After transforming both instruments into normalized returns, the script evaluates how similar those returns are bar by bar. When the two assets consistently deliver returns of similar sign and magnitude, this component is high and positive. When they frequently diverge or move in opposite directions, it becomes negative. This captures short-term co-movement in a volatility-adjusted way.
The second component focuses on high–low swing alignment. Rather than looking only at closes, it examines the direction of changes in highs and lows for each bar. If both instruments are printing higher highs and higher lows together, or lower highs and lower lows together, the swing structure is considered aligned. Persistent alignment contributes positively to the correlation score, while repeated mismatches between the swing directions reduce it. This helps differentiate between superficial price noise and structural similarity in trend behaviour.
The third component is a classical Pearson correlation on closing prices, computed over a longer lookback. This serves as a stabilising backbone that summarises general co-movement over a broader window. By combining normalized return co-movement, swing alignment and standard price correlation with calibrated weights, the Correlation mode provides a richer view than a single linear measure, capturing both short-term dynamic interaction and longer-term structural linkage.
In Anticipation mode, Omega Correlation estimates whether the second asset tends to lead or lag the current chart. The output is again a continuous score around the range. Positive values suggest that the second asset is acting more as a leader, with its past moves bearing informative value for subsequent moves of the chart symbol. Negative values indicate that the second asset behaves more like a laggard or follower. Values near zero suggest that no stable lead–lag structure can be identified.
The anticipation score is built from four elements inspired by quantitative lead–lag and price discovery analysis. The first element is a residual lead correlation, conceptually similar to Granger-style logic. The script first measures how much of the chart symbol’s normalized returns can be explained by its own lagged values. It then removes that component and studies the correlation between the residuals and lagged returns of the second asset. If the second asset’s past returns consistently explain what the chart symbol does beyond its own autoregressive behaviour, this residual correlation becomes significantly positive.
The second element is an asymmetric lead–lag structure measure. It compares the strength of relationships in both directions across multiple lags: the correlation of the current symbol with lagged versions of the second asset (candidate leader) versus the correlation of lagged values of the current symbol with the present values of the second asset. If the forward direction (second asset leading the first) is systematically stronger than the backward direction, the structure is skewed toward genuine leadership of the second asset.
The third element is a relative price discovery score, constructed by building a dynamic hedge ratio between the two prices and defining a spread. The indicator looks at how changes in each asset contribute to correcting deviations in this spread over time. When the chart symbol tends to do most of the adjustment while the second asset remains relatively stable, it suggests that the second asset is taking a greater role in determining the equilibrium price and the chart symbol is adjusting to it. The difference in adjustment intensity between the two instruments is summarised into a single score.
The fourth element is a breakout follow-through causality component. The script scans for breakout events on the second asset, where its price breaks out of a recent high or low range while the chart symbol has not yet done so. It then evaluates whether the chart symbol subsequently confirms the breakout direction, remains neutral, or moves against it. Events where the second asset breaks and the first asset later follows in the same direction add positive contribution, while failed or contrarian follow-through reduce this component. The contribution is also lightly modulated by the strength of the breakout, via the underlying normalized return.
The four elements of the Anticipation mode are combined into a single leading correlation score, providing a compact and interpretable measure of whether the second asset currently behaves as an effective early signal for the symbol you trade.
To aid interpretation, Omega Correlation builds dynamic bands around the active series (correlation or anticipation). It estimates a long-term central tendency and a typical deviation around it, plotting upper and lower bands that highlight unusually high or low values relative to recent history. These bands can be used to distinguish routine fluctuations from genuinely extreme regimes.
The script also computes percentile-based levels for the correlation series and uses them to track two special price levels on the main chart: lost correlation levels and gained correlation levels. When the correlation drops below an upper percentile threshold, the current price is stored as a lost correlation level and plotted as a horizontal line. When the correlation rises above a lower percentile threshold, the current price is stored as a gained correlation level. These levels mark zones where a historically strong relationship between the two markets broke down or re-emerged, and can be used to frame divergence, convergence and spread opportunities.
An information panel summarises, in real time, whether the second asset is behaving more as a leading, lagging or independent instrument according to the anticipation score, and suggests whether the current environment is more conducive to de-alignment, re-alignment or classic spread behaviour based on the correlation regime. This makes the tool directly interpretable even for users who are not familiar with all the underlying statistical details.
Typical applications for Omega Correlation include intermarket analysis (for example, index vs index, commodity vs related equity sector, FX vs bonds), dynamic hedge sizing, regime detection for algorithmic strategies, and the identification of lead–lag structures where a macro driver or benchmark can be monitored as an early signal for the instrument actually traded. The indicator can be applied across intraday and higher timeframes, with the understanding that the strength and nature of relationships will differ across horizons.
Omega Correlation is designed as an advanced analytical framework, not as a standalone trading system. Correlation and lead–lag relationships are statistical in nature and can change abruptly, especially around macro events, regime shifts or liquidity shocks. A positive anticipation reading does not guarantee that the second asset will always move first, and a high correlation regime can break without warning. All outputs of this tool should be combined with independent analysis, sound risk management and, when appropriate, backtesting or forward testing on the user’s specific instruments and timeframes.
The intention behind Omega Correlation is to bring techniques inspired by quantitative research, such as normalized return analysis, residual correlation, asymmetric lead–lag structure, price discovery logic and breakout event studies, into an accessible TradingView indicator. It is intended for traders who want a structured, professional way to understand how markets interact and to incorporate that information into their discretionary or systematic decision-making processes.
Spreadtrading
Spot - Fut spread v2"Spot - Fut Spread v2"
indicator is designed to track the difference between spot and futures prices on various exchanges. It automatically identifies the corresponding instrument (spot or futures) based on the current symbol and calculates the spread between the prices. This tool is useful for analyzing the delta between spot and futures markets, helping traders assess arbitrage opportunities and market sentiment.
Key Features:
- Automatic detection of spot and futures assets based on the current chart symbol.
- Flexible asset selection: the ability to manually choose the second asset if automatic selection is disabled.
- Spread calculation between futures and spot prices.
- Moving average of the spread for smoothing data and trend analysis.
Flexible visualization:
- Color indication of positive and negative spread.
- Adjustable background transparency.
- Text label displaying the current spread and moving average values.
- Error alerts in case of invalid data.
How the Indicator Works:
- Determines whether the current symbol is a futures contract.
- Based on this, selects the corresponding spot or futures symbol.
- Retrieves price data and calculates the spread between them.
- Displays the spread value and its moving average.
- The chart background color changes based on the spread value (positive or negative).
- In case of an error, the indicator provides an alert with an explanation.
Customization Parameters:
-Exchange selection: the ability to specify a particular exchange from the list.
- Automatic pair selection: enable or disable automatic selection of the second asset.
- Moving average period: user-defined.
- Colors for positive and negative spread values.
- Moving average color.
- Background transparency.
- Background coloring source (based on spread or its moving average).
Application:
The indicator is suitable for traders who analyze the difference between spot and futures prices, look for arbitrage opportunities, and assess the premium or discount of futures relative to the spot market.
[ AlgoChart ] - Compare MarketIndicator Description:
This indicator allows you to display a second asset, selectable from the input panel, in a separate window. Plotted on the same time scale as the first asset but with a distinct price scale, the indicator enables analysis of the relationships and relative movements of two financial instruments. It’s an ideal tool for understanding whether two assets move in a correlated or divergent manner.
Key Features:
Multi-Asset Comparison: Display two assets simultaneously to compare their trends.
Custom Scale: Each asset uses its own price scale, making comparative analysis easier.
Intuitive Interface: Easily select the second asset through the input panel.
Operational Applications:
Spread Trading: Identify optimal moments to execute spread trades when two highly correlated instruments move in opposite directions.
Supply & Demand: Pinpoint zones of interest on both assets, increasing the validity of support and resistance areas.
Exposure Reduction: Monitor instruments that move similarly to avoid exposing the portfolio in identical directions, thereby reducing the risk of double losses.
Additional Features:
Candle Color Change: When a directional divergence occurs between the two assets, the candles change color to highlight the event.
Customizable Notifications: Receive instant alerts when a divergence occurs, allowing you to act promptly.
[ AlgoChart ] - Pearson Index CorrelationCorrelation Indicator (Pearson Index)
The correlation indicator measures the strength and direction of the relationship between two financial assets using the Pearson Index.
Correlation values range from +100 to -100, where:
+100 indicates perfect positive correlation, meaning the two assets tend to move in the same direction.
-100 indicates perfect negative correlation, where the two assets move in opposite directions.
The neutral zone ranges from +25% to -25%, suggesting that the asset movements are independent, with no clear correlation between them.
Interpreting Correlation Levels:
Correlation above +75%: The two assets tend to move similarly and in the same direction. This may indicate a risk of overexposure if both assets are traded in the same direction, as their movements will be very similar, increasing the likelihood of double losses or gains.
Correlation below -75%: The two assets tend to move similarly but in opposite directions. This correlation level can be useful for strategies that benefit from opposing movements between assets, such as trading pairs with inverse dynamics.
Practical Use of the Indicator:
Risk management: Use the indicator to monitor asset correlations before opening positions. High correlation may indicate you are duplicating exposure, as two highly correlated assets tend to move similarly. This helps avoid excessive risk and improves portfolio diversification.
Statistical Arbitrage: During moments of temporary decorrelation between two assets, the indicator can be used for statistical arbitrage strategies. In such cases, you can take advantage of the divergence by opening positions and closing them when the correlation returns to higher or positive levels, thus potentially profiting from the reconvergence of movements.
While the correlation indicator provides valuable insights into asset relationships, it is most effective when used in conjunction with other concepts and tools. On its own, it may offer limited relevance in trading decisions.
Arbitrage SpreadThis indicator helps to find spreads between cryptocurrencies, assess their correlation, spread, z score and atr z score.
The graphs are plotted as a percentage. Because of the limitation in pine tradingview for 5000 bars a period was introduced (after which a new starting point of the graph construction will be started), if you want it can be disabled
The multiplier parameter affects only the construction of the joint diagram on which z score and atr z score are calculated (construction of the diagram is done by dividing one pair by another and multiplying by the multiplier parameter) is shown with a red line
To create a notification you have to specify the data for parameters other than zero which you want to monitor. For parameters z score and atr z score data are counted in both directions
The data can be tracked via the data window
Link to image of the data window prnt.sc
Spread ChartThis script lets you chart a spread of a maximum of 3 tickers (one of them being the ticker in the main chart).
Y axis is the currency amount of the spread, that is calculated by this formula:
Y = PnL = quantity * price * handleValue
Y is calculated for each ticker specified, and the sum of Ys obtained is plotted.
this way it is possible to view the PnL of the spread directly.
It is necessary to specify the handle value (point value) in the script inputs (not for the main chart ticker).
A table summarizes the spread configuration, containing all inputs.
two_leg_spread_diffThis script helps you discern the relative change of each leg in a two-legged spread over a given period. The main plot is a difference in log return over the number of bars identified by the "lag" parameter. E.g. if "lag" is 10 and leg one has increased 3% over the past ten bars, while leg two has only increased 1%, the plot value is 2%. The main plot is also colored blue when leg one increases while leg two decreases on a given bar, and red if the opposite is true. This feature identifies periods where the correlation between the two legs diminishes. The one and two standard deviation of the main plot is also plotted in faint background lines. Additionally, a table indicates the percentage in which the main plot is within one standard deviation (acc 1) and two standard deviations (acc 2). Note that the standard deviation updates on each bar, so the current standard deviation is not the one used to calculate the accuracy. Rather, if there are N bars, N different standard deviation readings have been used to compute the accuracy statistics.
The inputs are:
- timeframe: the timeframe of the chart
- leg1_sym: the symbol of the first leg
- leg2_sym: the symbol of the second leg
- lag: the number of bars back to reference for computing the log return of each leg
- anchor_to_session_start: for intraday charts only, this overwrites the "lag" input so that the "lag" always sets the point of comparison to the session start. This setting is used to compute the relative change over a single session.
Nasdaq DowJones STOCH+RSIAlternative & UPDATED version of my previous indicator for spread trading.
This indicator can work pretty well also with other indices or correlated assets such as nasdaq100 and dax40.
The spikes from one side of the channel or the orizzontal lines signal a possible entry signal for a spread trading strategy.
Nasdaq DowJones RATIOThis script gives you the ratio between the Nasdaq 100 and the Dow 30 (nas100/dow30). The RSI helps you understand when one of the two indices is overbought or oversold compared to the other one. This indicator is supposed to be of help for the strategy called spread trading, which consists in shorting an asset and buying the other one.
Spread InformerThe goal of this study is to produce information about the average size of candles in the given time frame. This can be used to help dial in your market making bot spreads.
Spread PercentThis indicator shows the percent change between the highs and the lows (or optionally the open and close) of each candle. You may also set a low and a high percent threshold to better highlight the candles that exceed your desired spread percent. Red signifies low spread, green is high spread - these are unrelated to the color of the candle body. There is also the option to display a moving average of the spread percent at your desired length which is a representation of volatility over time.
This is not only helpful for historical analysis over time, but this can also be a time saver if you are trying to calculate the measured distance of a move. Save clicks - no more needing to use the measuring tool.
The settings of the indicator on the chart above are:
- Measure Candle Body Only? - No
- Highlight Thresholds? - Yes
- Thresholds Based on Moving Averages? - Yes
- Low Percent Threshold - 3.0
- High Percent Threshold - 7.0
- Show Moving Average? - Yes
- Moving Average Length - 5
SpreadTrade - CointegrationThe Cointegration strategy is to short the outperforming instrument and go long on the underperforming instrument
whenever the temporary correlation weakens which means one instrument going up and another going down.
Here, instead of two different instruments two timeframes of the same instrument are used, lower and higher.
PT_maSpreadThis indicator is designed for use with Profit Trailer's SPREAD strategies.
The user can select either EMA or SMA averages and input their own buy value settings.
It incorporates trailing values, either manual trailing values or automatically calculated values based on volatility.













