Multi-Asset Similarity Matrix Using Return-Based Measures
Summary
This indicator compares selected assets over a rolling window and displays pairwise similarity scores in a color-coded table. Users supply a ticker list and choose either returns or volume-modified returns, then select among measures including correlation, cosine similarity, distance metrics, and error measures. Each asset pair receives a score, while the diagonal identifies the asset itself; colors map the observed scores from the matrix minimum to its maximum.
The matrix can help researchers screen for assets whose recent series move similarly or differently, potentially informing diversification or relative-value investigation. The default window is short, and the color scale is normalized to the current set of pairwise scores, so colors are relative to the selected assets and may change as the window or universe changes. Similarity measures do not all share the same interpretation or direction, and the document provides no validation, trading rules, or evidence that a high or low score predicts future returns. The script also requests external series with lookahead enabled, a detail that requires care when interpreting historical values.
Key ideas
- The tool compares selected assets using a rolling window of returns or volume-modified returns.
- Users can select from correlation, similarity, distance, and error measures with differing interpretations.
- A pairwise table displays the scores, with colors scaled between the current matrix minimum and maximum.
- The results are descriptive and do not establish future return predictability or a trading strategy.
- Lookahead-enabled external data requests warrant caution when interpreting historical output.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.