Every great potion begins with quality ingredients. I harvested:
1 year of market data for TSLA, GOOGL, AMZN, and BRK-B
50,000+ data points of OHLC prices and volumes
Precision tools: Pandas for data wrangling, yfinance for live feeds
Raw data is wild magic - I tamed it with:
50-day & 200-day Moving Averages revealing TSLA's mood swings
Daily return distributions showing AMZN's kurtosis (fat tails)
Volume spikes analysis predicting BRK-B's quiet strength
I discovered hidden relationships through:
Heatmap sorcery showing GOOGL-AMZN's 0.52 correlation
Covariance matrices proving BRK-B's diversification power
10,000 simulated portfolios revealed:
Maximum Sharpe Ratio of 2.29 (23% better than S&P 500)
Optimal weights: 17.8% AMZN, 5.4% TSLA, 15.3% GOOGL, 61.5% BRK-B
Maximum Sharpe Return of 33%
Risk-return sweet spot at 15% volatility
Three elixirs of optimal performance emerged:
18.5789 AMZN, 5.1455% TSLA, 15.8968% GOOGL, 60.3789% BRK-B
16.6440%AMZN, 5.3499% TSLA, 14.6621% GOOGL, 63.3440% BRK-B
17.8025% AMZN, 5.3034% TSLA, 15.3061% GOOGL, 61.5880% BRK-B
Curious about the code?
Visit my Github to see the magic behind the numbers!