compare_assets
Measure how two or more assets move together by computing the correlation matrix of daily returns over a chosen period, helping evaluate diversification and portfolio risk.
Instructions
Compute the correlation matrix of daily returns between two or more assets.
Args: tickers: Two or more ticker symbols to correlate, e.g. ['AAPL', 'MSFT', 'GOOGL']. period: Lookback window: one of '1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'.
Returns a ticker-by-ticker correlation matrix of daily returns (-1 to 1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | 1y | |
| tickers | Yes |