Skip to content

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

Notifications You must be signed in to change notification settings

Sujith-DA279/Quant_Financial_Analytics

Repository files navigation

Quantitative Financial Analytics: Decoding Stock Returns Through Earnings, Macro, and Sentiment Analysis

πŸ“‹ Project Brief

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.

🎯 Business Objectives

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

Project Overview:

⏱️ Duration πŸ† Grade πŸ› οΈ Tools πŸ“Š Datasets
6 Weeks 80% (Distinction) 20+ years of stock data
5 macroeconomic indicators
1,423 news articles

πŸ” Analytical Methodology

Data Sources and Collection

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

Data Ingestion from Different Opensource APIs

Feature Engineering

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 Components

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

πŸ—οΈ Key Insights and Results

Earnings Analysis

  • 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

EPS Surprise vs Post announcement 2-day returns

Macroeconomic Analysis

Each company showed unique macro sensitivity profiles:

Company Primary Macro Correlations
Apple Federal Debt, Real GDP
Google 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.

Combined Correlation Heatmap - Returns vs Revenue and Macro factors

Sentiment Analysis

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)
Google 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.

Example of Event Study Analysis chart - Apple for Stock sentiment

Sentiment and Stock-price Trend around Earnings Announcements

Trading Strategy Performance

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%

πŸ› οΈ Technical Implementation

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

πŸ“Š Recommendations

Trading Strategy Recommendations

  1. Implement Stock-Specific Models: Different threshold parameters for each stock (Β±2% for AAPL, Β±5% for GOOGL/NVDA)
  2. Focus on Key Indicators:
    • EPS and Revenue Surprises (all stocks)
    • Pre-announcement BOP momentum
    • Company-specific financial metrics (profitability metrics for B2B stocks)
  3. Time-Window Optimization: 2-day trading window for GOOGL/NVDA, 5-day for AAPL
  4. Risk Management: Set tighter stop-loss for NVDA due to higher volatility
  5. Sentiment Integration: Use as supplementary signal, particularly for NVDA

Technical Recommendations

  1. Model Validation: Implement out-of-sample testing across diverse market conditions
  2. Ensemble Approaches: Test combining multiple models for signal generation
  3. Feature Refinement: Further customize feature importance by stock
  4. Continuous Learning: Establish monitoring system to adapt to evolving market dynamics

πŸ‘₯ Team

Project by Insight Alchemists Team:

  • Hemalatha Nagaraj
  • Manasa Chilakapati
  • Sagar Varma
  • Sujith Kumaar K C
  • Yuliya Pauzunova

About

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

Topics

Resources

Stars

Watchers

Forks