A single-page, client-side web application for visualising historical stock prices, technical indicators, and fundamental financial ratios. This dashboard offers a user-friendly interface for basic stock analysis, retrieving real-time and historical data from the Alpha Vantage API.
- Dynamic Data Fetching: Retrieves daily time-series data and company balance sheets from the Alpha Vantage API.
- Customizable Analysis: Users can specify the stock ticker symbol and a custom date range for analysis.
- Interactive Charts: Visualises data using Chart.js, providing a clear and responsive experience.
- Technical Indicators: Toggle and display key technical indicators on the charts:
- 50-Day & 200-Day Simple Moving Averages (SMA)
- 30-Day Rolling Volatility
- Daily Trading Volume
- Stochastic Oscillator (%K and %D lines)
- Fundamental Ratios: Calculates and displays essential financial health metrics from the latest quarterly balance sheet:
- Current Ratio
- Cash Ratio
- Debt-to-Equity Ratio
- Debt-to-Asset Ratio
- Data Export: Download the data for each chart as a
.csvfile with a single click. - Modern UI: Built with Tailwind CSS for a clean, responsive, and dark-mode-first design.
- Self-Contained: The entire application runs from a single HTML file with no server-side setup required.
- Download the Code: Clone the repository or download the
index.htmlfile. - Open in Browser: Open the
index.htmlfile directly in any modern web browser (like Chrome, Firefox, or Edge). - Analyze:
- The dashboard will automatically load data for "AAPL" (Apple Inc.) as a default.
- Enter a different stock ticker symbol in the "Ticker Symbol" field.
- Select your desired "Start Date" and "End Date".
- Check the boxes for the "Technical Indicators" you wish to see.
- Click the Analyse Stock button to fetch and display the new data.
- Frontend:
- HTML5
- JavaScript (ES6+)
- Styling:
- Charting:
- Chart.js for creating interactive charts.
chartjs-adapter-date-fnsfor handling time-series data on chart axes.
- Data Source:
- Alpha Vantage API for stock market and financial data.
This project uses a hardcoded demonstration API key for Alpha Vantage.
const apiKey = 'V3A08KY342LEPJ1M'; // Demo Key