Correlation Clusters

Aug 15, 2024

Static chart image
Machine Learning
Time Based
Correlation
Works on the following platforms:
tradingviewSymbolTradingView
For free use on the TradingView platform
ninjatraderNinjaTrader
For free use on the NinjaTrader platform
metatrader4MetaTrader 4
For free use on the MetaTrader 4 platform
metatrader5MetaTrader 5
For free use on the MetaTrader 5 platform
thinkorswimThinkorswim
For free use on the Thinkorswim platform

The Correlation Clusters is a sophisticated machine learning tool designed to assist traders in identifying and grouping sets of tickers that share a similar correlation coefficient with a reference ticker specified by the user. This intelligent tool calculates the correlation coefficients between ten user-selected tickers and one reference ticker, allowing for the formation of up to ten distinct clusters.

How to Trade the Correlation Clusters Indicator?

indicator image

Applying clustering methods to correlation analysis can enable traders to swiftly pinpoint which tickers correlate with a reference ticker, thus eliminating the manual task of examining each individually or relying on cumbersome approaches like correlation matrices. Tickers within a cluster are more likely to exhibit a higher degree of mutual correlation. The image above highlights the crucial components of the Correlation Clusters tool.

The correlation coefficient is a valuable measure that traders use to understand the relationship between two assets. This coefficient ranges from +1.0 to -1.0 and is interpreted as follows:

  • Near +1.0: The assets move in tandem, rising or falling concurrently.
  • Close to 0.0: The assets have no significant relationship, behaving independently.
  • Near -1.0: The assets exhibit inverse behavior; when one rises, the other falls.

Trading Strategies Using Correlation Coefficients

Correlation coefficients are instrumental in various trading strategies, including:

  • Pair Trading: This strategy involves exploiting price movements between closely correlated assets. Although assets with a high positive correlation typically move in sync (+1.0), divergences can present profitable opportunities. Traders might buy one asset and sell the other, anticipating a return to synchronized movement.
  • Sector Rotation: Investors track sector correlations with each other and the broader market to capitalize on expected performance in different economic cycles.
  • Diversification: A diversified portfolio comprises uncorrelated assets, minimizing risk. Positive correlations across portfolio assets amplify risk, as adverse moves affect the entire portfolio similarly. Opting for uncorrelated assets can offset these risks by facilitating independent movement.
  • Hedging: In hedging, traders may pair long positions with long positions in negatively correlated assets or short positions in positively correlated assets, balancing exposure.

Effectively grouping assets based on similar behavior assists traders in minimizing over-exposure to related assets. It's crucial to recognize when multiple long positions might concentrate risk rather than diversifying it. The tool assists in identifying uncorrelated candidates by highlighting clusters near a correlation of 0, facilitating diversification.

Details on Correlation Clusters Indicator

K-means clustering, a cornerstone of machine learning, is deployed to group similar data points. This method commences without predetermined labels, assigning data points to random groups and computing each group's center (centroid). The algorithm iteratively refines groups to minimize variance from their centroids.

Execution Window

indicator image

The image depicts how varied execution windows yield diverse correlation coefficients, informing on asset behavior over time. Traders can choose to filter correlation data by bars, time, or use all available data. For instance, using a 15-minute chart, a trader might analyze behavior over one week; or on a 1-hour chart, set a one-month window. The default pulls from the last 50 bars.

Clusters

indicator image

This graph illustrates multiple clusters for identical data, with each cluster color-coded and dotted lines indicating centroids. Selectable up to 10 clusters, the algorithm may return fewer based on data variance. Settings like 'Cluster Threshold' and 'Max Iterations' customize the algorithm, but adjustments require understanding. Defaults suffice for most applications.

Correlations

indicator image

Different correlations suggest varied behaviors relative to a single asset, as illustrated. Traders commonly analyze correlations against a single asset, utilizing the chart ticker or a manually set alternative. Select up to 10 tickers to ascertain correlation coefficients, aiding in the examination of diverse asset behaviors.

Configuration Settings for the Indicator

  • Execution Window Mode: Choose data collection methods: by number of bars, by time, or without filtering.
  • Execute on Last X Bars: Define bar count for data collection in 'Bars' mode.
  • Execute on Last: Define time duration for data in 'Time' mode, with periods like 'Day' (24 hours), 'Week' (7 days), etc.

Clusters Configuration

  • Number of Clusters: Set clusters up to a maximum of 10.
  • Cluster Threshold: Determines centroid accuracy based on proximity; lower values enhance precision.
  • Max Iterations: Maximum cycle count for cluster detection, noting high values may cause timeouts.

Ticker of Reference Configurations

  • Use Chart Ticker as Reference: Toggle usage of the current chart ticker against selected tickers.
  • Custom Ticker: Define a custom reference for correlation against selected tickers.

Correlation Tickers Selection

Select ten tickers to determine their correlation to the reference ticker.

Style Settings

  • Text Size: Define display text size.
  • Display Size: Alter correlation chart size up to 500 bars.
  • Box Height: Adjust box height to prevent overlaps.
  • Clusters Colors: Set individual cluster colors.

FAQ

How can I access the Correlation Clusters Indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What is the purpose of selecting a Custom Ticker? It lets users explore correlations against a specific asset not shown on the current chart.

Why are there sometimes fewer clusters than requested? The K-means algorithm might not identify enough distinctive groups within the data to reach the selected cluster count, reflecting data similarity.

Trading is risky and many will lose money in connection with trading activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other markets involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools for charting platforms, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content or tool we provide.

Charts used on this site are by TradingView in which the majority of our tools are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com. TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2025 LuxAlgo Global, LLC.