pat42w / ef_portfolio_optimization Goto Github PK
View Code? Open in Web Editor NEWThis project aims to test Portfolio Optimization methods on stock data in python.
License: MIT License
This project aims to test Portfolio Optimization methods on stock data in python.
License: MIT License
Create a notebook or py script to test the main functionality of the repo with any future pull requests.
Negative prices in the price data this shouldn't be possible, seeing this as an issue in yfinance repo.
perhaps a drop of any columns with negatives would be an interim fix.
I will investigate further.
Until this is solved our modeling is pointless.
Another example is ITRN
import yfinance as yf
yf.download(['MSFT','ITRN'],'2006-1-1')['Adj Close']
Originally posted by @pat42w in ranaroussi/yfinance#138 (comment)
All must be formatted as TSVs & have two columns Symbol containing the share/stock's ticker & Description containing its name
-London Stock Exchange
-Irish
-European
-Japanese
-Canadian
Testing notebook that will take a pipeline or function, index & date range and test how the optimal portfolio performs vs actual
database=df_Nasdaq startdate=pd.to_datetime("2015-08-01") enddate=pd.to_datetime("2016-12-01") dmf.portfolio_generate_test(database,startdate,enddate,p_max=250, min_returns=0.01, s_asset=0, asset_len=50, silent=False, obj_method="SHARPE")
Results in inf
When generating portfolios since we have no financing costs we should have a risk free rate of 0 applied. As we have no financing cost
Getting this when pushing to main branch
PS C:\Users\eogha\EF_Portfolio_Optimization> git push
Enter passphrase for key '/c/Users/eogha/.ssh/id_ed25519':
Enumerating objects: 12, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 7.33 MiB | 84.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 2 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: error: At least 2 approving reviews are required by reviewers with write access.
To github.com:pat42w/EF_Portfolio_Optimization.git
! [remote rejected] main -> main (protected branch hook declined)
error: failed to push some refs to 'github.com:pat42w/EF_Portfolio_Optimization.git'
I think I have unsufficient perms @pat42w
Now that we have the data currency & forex as we want it, we should start to think about how to use it.
there are lots of approaches to take, we have the Effiencient frontier, we can look at time series forecasting of stocks, or groupings by type etc.
have a think about how should we go about these analysis
Testing in relatively fresh environment on my Windows PC to check for additional required packages to add to requirements.txt
Will be useful for testing to only pull stock data for a subset of dates
Move DB download & helper function definitions out of notebook and import as a library instead
NYSE has redundant tickers example BSN.U: No data found, symbol may be delisted these should be removed from the TSV file.
This culd be done manually but would be good to have logic as we add more indexes
When run dmf.gen_curr_csv(start_date)
in 1_Database_maintainance.ipynb i get the following error:
ConnectionError: None: Max retries exceeded with url: /api/2007-01-01?base=USD&symbols=EUR&rtype=fpy (Caused by None)
Currently all portfolios are in the index's currency rather than euro.
Perhaps a database of daily Euro to other currency prices is the way to go here
Introduce list of available index's which is checked when entering index name in any of the database function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.