Skip to content

Repository files navigation

📈 QuantMacro Analytics Engine

Institutional-Grade Cross-Asset Research Pipeline & Risk Terminal

I built the QuantMacro Analytics Engine as a comprehensive quantitative research pipeline to analyze 27 years of cross-asset financial data (1999–Present). Covering major equities, commodities, cryptocurrencies, and bond yields, this engine moves beyond standard performance tracking. It delivers robust risk profiling, statistical causality testing, and historical stress-testing.

The project operates in two phases: a Python & SQLite backend that processes raw market data into actionable statistical insights, and an interactive Power BI frontend that serves as a professional risk-monitoring terminal.


📊 The Power BI Risk Terminal

The output of the quantitative pipeline is visualized in a custom-built Power BI terminal, designed to provide instant clarity on capital destruction, tail-risk, and multi-asset performance.

1. Tail-Risk & Drawdown Dashboard

Visualizing capital erosion, recovery cycles, and extreme tail-risk metrics (VaR/CVaR). Tail-Risk Analysis

2. Macro Performance Summary

A top-down view of annualized returns, volatility, and historical market regime distribution. Summary Dashboard


⚙️ Core Analytical Pipeline (Python & SQL)

The backend engine (QuantMacro_Analytics_Engine.ipynb) is the heart of this project. It processes over 50,000 rows of historical market data, executing a rigorous workflow that bridges Python data engineering with advanced SQL window functions.

1. Data Ingestion & Feature Engineering

  • Historical Data: Leveraged yfinance to pull 27 years of daily pricing data across eight major assets (S&P 500, Nasdaq 100, Dow Jones, Gold, Silver, Crude Oil, Bitcoin, and US 10-Year Yields).
  • Quantitative Features: Engineered critical predictive columns using Pandas and NumPy, including daily logarithmic returns (np.log(x / x.shift(1))), 30-day annualized rolling volatility, and 50/200-day Simple Moving Averages.
  • Database Architecture: Built a local SQLite database (quant_macro_engine.db), storing the cleaned and enhanced 50,045-row DataFrame into a structured fact_enhanced_market_prices table for advanced downstream querying.

2. Statistical Testing & Macro Linkages

Instead of relying on basic visual correlations, I used statsmodels to mathematically verify market relationships:

  • Stationarity Testing: Utilized Augmented Dickey-Fuller (ADF) tests. I proved that raw prices are non-stationary (p=1.0000), but daily logarithmic returns provide a statistically sound, stationary foundation for modeling (p=0.0000).
  • Predictive Causality: Deployed Granger Causality tests (checking up to a 5-day lag) to confirm that movements in the US 10-Year Yield predictively lead changes in the Nasdaq 100 (p < 0.01).
  • Dynamic Correlations: Analyzed 90-day rolling correlations to show how the relationship between equities and safe havens (like Gold) structurally flips negative during systemic liquidity shocks.

3. Advanced SQL Tail-Risk Profiling

  • Time-in-Drawdown via SQL: Rather than relying purely on Python, I implemented advanced SQL queries utilizing Common Table Expressions (CTEs) and Window Functions to calculate running peak-to-trough drawdowns dynamically in the database layer.
    MAX(Close_Price) OVER (PARTITION BY Asset_Name ORDER BY Trade_Date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
  • Fat-Tail Exposure: Calculated daily Value at Risk (VaR 95%) and Expected Shortfall (CVaR 95%) using quantile thresholds to measure true fat-tail exposure.

4. Market Regime Classification & Stress-Testing

  • Regime Logic: Used SMA 50/200 crossover logic to dynamically classify assets into Bull (Risk-On) or Bear (Risk-Off) regimes.
  • Historical Crisis Simulations: Built a scenario engine to simulate portfolio capital flight during the Dot-Com Crash (2000-2002), the 2008 Global Financial Crisis, the 2020 COVID-19 Shock, and the 2022 Inflation/Rate Hike cycle.

2008 GFC Performance


💡 Click to view Key Quantitative Insights

By running this engine across multi-decade data, several structural market truths were mathematically verified:

  • The Risk-Reward Spectrum: Bitcoin generated the highest risk-adjusted return (Sharpe: 0.56) with a 33.51% annualized return, but carried a massive 54.72% annualized volatility and severe tail-risk (CVaR: -8.37%).
  • The Gold Safe-Haven Validated: Gold maintained an 11.14% annualized return with the lowest tail-risk among commodities. It reliably acted as a flight-to-safety vehicle, generating positive returns (+28.56%) during the 2008 GFC while equities collapsed.
  • The Structural Equity Updrift: Major U.S. Indices (S&P 500, Nasdaq 100) spend approximately 72–73% of their trading history in a confirmed Bull Regime, quantifying the long-term tailwind of global economic expansion.
  • Commodity Cyclicality: Unlike equities, Crude Oil and Silver display a near 50/50 split between Bull and Bear regimes, proving they are tactical, cyclical instruments rather than buy-and-hold wealth compounders.

🛠️ Technology Stack

  • Data Ingestion & Engineering: Python, Pandas, NumPy, yfinance
  • Quantitative Modeling: statsmodels (ADF, Granger Causality)
  • Data Storage & Querying: SQLite (CTEs, Window Functions)
  • Visualization (Backend): Matplotlib, Seaborn
  • Terminal/Frontend: Power BI (DAX, Interactive visual matrices)

📂 Repository Structure

File/Folder Description
QuantMacro_Analytics_Engine.ipynb The core Python and SQL notebook containing the full quantitative research pipeline.
QuantMacro_Final_Dataset.csv The engineered dataset containing 50,000+ rows of log returns, rolling volatility, and SMA data.
QuantMacro_Terminal_Dashboard.pbix The interactive Power BI dashboard file.
*.png High-resolution exports of the Power BI terminal and Python charts.

🚀 How to Use

  1. Clone the repository to your local machine.
  2. To explore the code and statistical models, open QuantMacro_Analytics_Engine.ipynb in Jupyter Lab or VS Code.
  3. Ensure you have the required dependencies installed (e.g., pip install pandas numpy yfinance statsmodels).
  4. To explore the interactive dashboards, open QuantMacro_Terminal_Dashboard.pbix using Power BI Desktop.

👤 About the Author

Abdul Wahab Jhare Data Analyst & Analytics Engineer

Professional Summary I am a Data Analyst and Analytics Engineer with over 5 years of experience transforming complex, large-scale datasets (100M+ records) into actionable, revenue-driving business strategies. Specializing in sales, marketing, and reliability analytics, my expertise spans across building robust ETL pipelines, designing scalable data models (Star Schema), and tracking critical KPIs such as MTBF, MTTR, and customer conversion funnels.

Leveraging advanced SQL, Python (Pandas, NumPy), and cloud computing platforms like Databricks, AWS, and Azure, I have a proven track record of engineering solutions that solve real-world problems. My past impact includes uncovering deep behavioral segments that generated over $650K in annual recurring revenue and automating manual workflows to drastically reduce processing times. Whether developing comprehensive Power BI dashboards or conducting predictive analytics, I am passionate about optimizing data infrastructure and empowering stakeholders through clear data storytelling.

Professional Experience

  • Data Analyst | NewGen Technomate (2022 – Present): Specializes in leveraging SQL, Power BI, and Python to optimize data infrastructure and drive revenue-focused business intelligence.

Education

  • Bachelor of Engineering (B.E.) in Mechanical Engineering, North Maharashtra University
  • Diploma in Mechanical Engineering

Contact & Portfolio

About

A quantitative macro analytics engine analyzing 27 years of cross-asset data. Features statistical testing (ADF, Granger Causality), tail-risk profiling (VaR/CVaR), regime classification, and crisis stress-testing using Python, Statsmodels, and SQLite. Outputs a finalized dataset optimized for Power BI ingestion.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages