https://github.com/fedesgh/finding_best_portfolio_efficient_frontier
Finding the best portfolio for a list of stocks using efficient frontier
https://github.com/fedesgh/finding_best_portfolio_efficient_frontier
efficient-frontier yfinance
Last synced: about 1 year ago
JSON representation
Finding the best portfolio for a list of stocks using efficient frontier
- Host: GitHub
- URL: https://github.com/fedesgh/finding_best_portfolio_efficient_frontier
- Owner: Fedesgh
- License: apache-2.0
- Created: 2024-10-01T15:04:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-25T21:47:42.000Z (over 1 year ago)
- Last Synced: 2025-05-21T20:11:19.489Z (about 1 year ago)
- Topics: efficient-frontier, yfinance
- Language: C
- Homepage:
- Size: 23.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Idea
Using yfinance we want to find the best portfolio given an upper bound risk, and a list of stocks.
## Functions
Basic functions are Log return (**portfolio_return**) , portafolio standart deviation (**std_portfolio**), and a weights random generator (**weights_gen**).
The inputs are **ticker** wich are **yfinance ticker** like "COME.BA" , "BYMA.BA", etc. and **weights** generated by **weights_gen**

Then we construct **frontier** with inputs **stocks** wich are a list of **yfinance tickers** , and **iterations** wich is the number of iterations that our function **weights_gen** will create randoms weights.

The output is a **dataframe** with **Return**, **Risk** for each combination of weights given by **weights_gen** for a particular list of tickers (stocks in our porfolio).

Finally we build **find_best** wich is a function that return the weights compositions with the **best return** given and upper bound **Risk** that we want assume for a set of stocks. The input is the data frame provided by **frontier**

