Skip to content

Instantly share code, notes, and snippets.

View Polyterative's full-sized avatar

Vlady Yakovenko Polyterative

View GitHub Profile
@Polyterative
Polyterative / Portfolio Optimization and Analysis.py
Last active May 12, 2023 21:31
Portfolio Optimization & Analysis: Python script using historical data to optimize ETF portfolio allocation. Evaluate returns, risk, and Sharpe ratio. Personalize inputs for custom analysis.
import numpy as np
import pandas as pd
import yfinance as yf
etfs = ['SWDA.MI', 'AGGH.MI', 'VECP.MI', 'VGEA.MI', 'RENW.MI', 'EIMI.MI', 'DRVE.MI']
portfolio_amounts = [58.91, 3.74, 12.58, 12.01, 2.89, 7.21, 2.71]
annual_fees = [0.20, 0.10, 0.09, 0.07, 0.49, 0.18, 0.10]
risk_free_rate = 0.02
total_investment = sum(portfolio_amounts)