Quantitative Financial Analytics: Decoding Stock Returns Through Earnings, Macro, and Sentiment Analysis
This project conducted an in-depth analysis of stock market behaviour for major tech companies (Apple, Google, and NVIDIA) to identify opportunities for trading strategies around earnings announcements. Using Python, advanced statistical methods, and machine learning, our team delivered actionable insights that can drive enhanced trading decision-making by understanding the relationships between stock price movements, earnings announcements, macroeconomic conditions, and news sentiment.
The analysis addressed key business needs:
- Understanding stock price movements before and after earnings announcements
- Identifying the impact of key financial metrics on stock performance
- Analysing macroeconomic influences on earnings outcomes and stock prices
- Determining the role of news sentiment in market reactions
β±οΈ Duration | π Grade | π οΈ Tools | π Datasets |
---|---|---|---|
6 Weeks |
|
80% (Distinction) |
20+ years of stock data 5 macroeconomic indicators 1,423 news articles |
Data Category | Source | Time Period | Key Metrics |
---|---|---|---|
Stock Price Data | Yahoo Finance API | 2000-2024 | OHLCV (Open, High, Low, Close, Volume) |
Financial Metrics | Financial Modeling Prep (FMP API) | 2000-2024 | Earnings, Revenue, Key Financial Ratios |
Macroeconomic Indicators | Federal Reserve Economic Data (FRED API) | 2000-2024 | GDP, Inflation, Unemployment, Federal Debt, Treasury Yields |
News Sentiment | NY Times Articles (Client provided Data) | 2019-2024 | 1,423 articles after cleanup |
We created 90+ derived features across the following categories:
Feature Category | Examples |
---|---|
Stock Metrics | Daily Returns, Balance of Power (BOP), Pre/Post Announcement Returns, Price Coefficient of Variation |
Financial Indicators | EPS Surprise, Revenue Surprise, Standardized Surprise Scores, Profit Margins, ROE, ROA |
Macro Indicators | GDP Growth Rates (QoQ/YoY), Federal Debt Change, CPI Changes, Treasury Yield Movements |
Temporal Features | TTM Metrics, QoQ Changes, YoY Growth Rates |
Sentiment Scores | FinBERT Composite Scores, Company/Macro Sentiment Classification |
Analysis Type | Key Methodologies | Analytical Techniques | Outcomes |
---|---|---|---|
Earnings Event Analysis | β’ Event study framework β’ Multiple return windows (1-5 days) β’ Cross-sectional surprise analysis |
β’ Winsorization of extreme values β’ Segmentation by surprise direction β’ Temporal decomposition (2000-2024) |
β’ 2-3 day optimal reaction window β’ ~0.3 correlation between EPS surprise and returns β’ Surprise threshold identification |
Macroeconomic Factor Analysis | β’ Correlation heatmaps β’ Time-series decomposition β’ Multi-factor regression β’ Company-specific correlations |
β’ Rate-of-change calculations (QoQ, YoY) β’ Rolling window correlations β’ Comparative macro sensitivity analysis |
β’ Unique company-macro sensitivity maps β’ Identified key indicators by company β’ Quantified revenue vs. macro impact |
News Sentiment Analysis | β’ NLP-based sentiment extraction β’ Rule-based article classification β’ 5-day pre/post-publication windows |
β’ FinBERT financial sentiment scoring β’ Publishing date Event-study β’ Sentiment-return correlation analysis |
β’ Company-specific sentiment responses β’ Negative news recovery patterns β’ Pre/post-earnings sentiment drift detection |
Trading Strategy Development | β’ Signal classification (Buy/Sell/Hold) β’ Random Forest ensemble modeling β’ Multi-factor integration β’ Backtesting framework |
β’ Company-specific thresholds β’ Hyperparameter optimization β’ Feature importance ranking β’ Performance metrics calculation |
β’ 6.5-12.7% average return per trade β’ 83-95% signal precision β’ Realized cumulative returns >20x β’ Feature importance hierarchies |
- EPS Surprise positively correlates with post-announcement returns (correlation ~0.3)
- Market reaction to surprises strongest within 2-3 days after announcement
- Pre-announcement momentum (BOP) shows positive correlation with post-announcement returns
Each company showed unique macro sensitivity profiles:
Company | Primary Macro Correlations |
---|---|
Apple | Federal Debt, Real GDP |
Real GDP, CPI, Treasury Yields | |
Nvidia | Real GDP, Treasury Yields, Unemployment |
Revenue growth consistently showed stronger impact on returns than macroeconomic factors for these high-growth tech companies.
News sentiment analysis revealed distinct patterns:
Company | Sentiment Response Pattern |
---|---|
Apple | Recovers from negative news within 3 days; positive drift otherwise (~1% in 5 days) |
Most stable to sentiment (returns within 1% window); acts as safe-haven during macro uncertainty | |
Nvidia | Highest sentiment sensitivity (Β±2-3% fluctuations); strong positive reaction to macro negativity |
Pre-earnings sentiment shows consistent optimistic bias with post-announcement sentiment typically declining.
Company | Avg. Return per Deal | Max Drawdown | Cumulative Return | Precision |
---|---|---|---|---|
AAPL | 6.5% | -14.8% | >20x (51 periods) | 83.3% |
GOOGL | 8.0% | 0.0% | >20x (39 periods) | 95.0% |
NVDA | 12.7% | -6.9% | ~700% (39 periods) | 88.9% |
The analysis was implemented using:
- Data Processing: Pandas, NumPy
- Machine Learning: Scikit-learn,StatsModels,
- ML Models: RandomForest, OLS, Binary and Multinomial Logistic Regression
- NLP: FinBERT, TextBlob
- Visualization: Matplotlib, Seaborn
- Implement Stock-Specific Models: Different threshold parameters for each stock (Β±2% for AAPL, Β±5% for GOOGL/NVDA)
- Focus on Key Indicators:
- EPS and Revenue Surprises (all stocks)
- Pre-announcement BOP momentum
- Company-specific financial metrics (profitability metrics for B2B stocks)
- Time-Window Optimization: 2-day trading window for GOOGL/NVDA, 5-day for AAPL
- Risk Management: Set tighter stop-loss for NVDA due to higher volatility
- Sentiment Integration: Use as supplementary signal, particularly for NVDA
- Model Validation: Implement out-of-sample testing across diverse market conditions
- Ensemble Approaches: Test combining multiple models for signal generation
- Feature Refinement: Further customize feature importance by stock
- Continuous Learning: Establish monitoring system to adapt to evolving market dynamics
Project by Insight Alchemists Team:
- Hemalatha Nagaraj
- Manasa Chilakapati
- Sagar Varma
- Sujith Kumaar K C
- Yuliya Pauzunova