The Top 20 Cryptocurrency Momentum and Correlation Analyzer is a Python-based tool designed to evaluate the performance and interrelationships of the top 20 cryptocurrencies by market capitalization. By leveraging the CoinGecko API, the script fetches the latest 30 days of historical price data for each selected cryptocurrency. It processes this data to calculate key metrics, including daily returns, 30-day percentage returns, and momentum scores, which collectively provide insights into each asset's performance trend over the specified period.
The script generates comprehensive outputs that provide a clear overview of the top 20 cryptocurrencies by market capitalization. It prints a summary table to the console, detailing each cryptocurrency's symbol, current price, 30-day percentage return, and calculated momentum score. Additionally, it produces a correlation matrix both as a printed table and as a visually intuitive heatmap, illustrating the relationships between the daily returns of the selected cryptocurrencies.
For visual analysis, the script saves line charts showing the price trends of each cryptocurrency over the past 30 days and a heatmap image representing their correlation coefficients. These outputs collectively enable users to assess individual performance and inter-asset relationships, facilitating informed investment and trading decisions.