This project analyses historical cryptocurrency market data to explore return, volatility, drawdowns, diversification, correlation with traditional markets, and portfolio optimisation strategies.
The goal is to understand how crypto assets behave individually and in combination, and to evaluate whether diversification improves risk-adjusted performance.
This is not just an analysis, it is a full data product, combining:
- π Exploratory Data Analysis
- βοΈ Financial metric engineering
- π² Monte Carlo portfolio simulation
- ποΈ SQL database layer
- π Tableau dashboards
- π Streamlit interactive application
Cryptocurrency markets are extremely volatile, unpredictable, and driven by rapid regime changes.
While they offer high return potential, they also expose investors to:
- sharp drawdowns
- unstable short-term movements
- shifting correlations
Traditional diversification principles donβt always hold in crypto markets.
This project explores whether data-driven portfolio construction can improve investment outcomes by balancing:
- return π
- risk
β οΈ - diversification π
- Identify top-performing cryptocurrencies
- Evaluate risk-adjusted performance
- Measure volatility and drawdowns
- Analyse time-based trends (short vs long term)
- Evaluate diversification benefits
- Compare crypto with S&P 500
- Optimise portfolios (Max Sharpe / Min Volatility)
- Compare strategies vs BTC and Equal Weight
Data collected via Yahoo Finance API (yfinance)
- BTC (Bitcoin)
- ETH (Ethereum)
- BNB (Binance Coin)
- SOL (Solana)
- ADA (Cardano)
- XRP
- DOT (Polkadot)
- DOGE (Dogecoin)
- LTC (Litecoin)
- S&P 500
- Daily data
- Python + yfinance API
- Missing values handling
- Time alignment
- Data consistency
- Daily & cumulative returns
- Annual return & volatility
- Rolling returns (30D / 90D)
- Rolling volatility
- Maximum drawdown
- Correlation (static & dynamic)
- Best & worst months/years
Monte Carlo simulation generates thousands of portfolios:
- Expected return
- Volatility
- Sharpe ratio
Outputs:
- Max Sharpe portfolio
- Min Volatility portfolio
- Efficient frontier
- Database creation
- Table structure
- CSV ingestion
- Validation queries
- Market overview
- Risk analysis
- Time-based trends
- Correlation analysis
- Portfolio insights
Interactive app where users can:
- Select assets
- Build portfolios
- Input exact weights
- Auto-adjust to 100%
- Compare strategies
- Explore Monte Carlo simulation
- Visualise performance
- Annual return
- Volatility
- Sharpe ratio
- Maximum drawdown
- Rolling metrics
- Correlation
- Expected return
- Portfolio volatility
- Sharpe ratio
- Drawdown
- Growth over time
- Optimal weights
- BNB & SOL β strongest risk-adjusted returns
- DOGE β high returns but extreme volatility
- BTC β more stable but lower upside
- All assets show extreme drawdowns
- Risk is not just volatility; downside is significant
- Short-term = unstable and spike-driven
- Long-term = clearer performance trends
- Low/moderate with S&P 500
- Increases during crises β diversification weakens
- Max Sharpe = best risk-return balance
- Min Vol = safer but lower returns
- Diversification improves stability
- High returns = high risk
- Not all crypto is equal
- Diversification helps, but fails under stress
- Portfolio construction matters
- Everything is a trade-off βοΈ
This project goes beyond static analysis.
It becomes a decision-support tool where users can:
- test strategies
- simulate portfolios
- explore outcomes interactively
π https://tableau-link
Crypto-Portfolio-Simulation-Optimization/
β
βββ data/
β βββ raw/
β β βββ crypto_prices_raw.csv
β βββ processed/
β βββ annual_returns_by_coin.csv
β βββ best_worst_months.csv
β βββ best_worst_years.csv
β βββ correlation_with_sp500.csv
β βββ crypto_prices_processed.csv
β βββ crypto_prices_processed_time_enriched.csv
β βββ crypto_sp500_merged.csv
β βββ crypto_summary_metrics.csv
β βββ max_sharpe_portfolio.csv
β βββ min_volatility_portfolio.csv
β βββ monthly_returns_by_coin.csv
β βββ portfolio_simulations.csv
β
βββ notebooks/
β βββ 01_data_collection.ipynb
β βββ 02_data_cleaning_and_returns.ipynb
β βββ 03_risk_metrics.ipynb
β βββ 04_portfolio_simulation.ipynb
β βββ 05_time_based_analysis.ipynb
β
βββ sql/
β βββ 01_create_database.sql
β βββ 02_create_tables.sql
β βββ 03_load_data.sql
β βββ 04_validation_queries.sql
β
βββ streamlit_app/
β βββ app.py
β βββ charts.py
β βββ data_loader.py
β βββ utils.py
β
βββ tableau/
β βββ Crypto Portfolio Simulation.twbx
β
βββ reports/
β βββ figures/
β
βββ README.md
βββ requirements.txt
- Python π
- pandas
- NumPy
- yfinance
- MySQL
- Tableau
- Streamlit
- Plotly
π©βπ» Marisa Oliveira
π§ marisaisabel27@hotmail.com
π https://www.linkedin.com/in/marisa-oliveira-business-data-analyst
Cryptocurrency markets are highly volatile and unpredictable.
This project is for educational purposes only and does not constitute financial advice.