Efficient Frontier vitualization using jupyter
Steps to use the demo
- Landing page, just slide.
- Login (without username and password, register is not working)
- Start searching any stock ticker (Some value might be NAN or Infinity due to data issue)
- Add desired tickers into portfolio
- Build portfolio, the optimizing process might take more than 10 seconds due to calculation (Error might occurs if BlackRock's api cannot provide the data). ** Recomended tickers: aapl, fb, googl
Edward's (jingyao97) elder brother is a finance student who represented Malaysia in stock challenge. He once asked Edward: "Why isn't there any free tools to simplify stock analysis and perform some calculation on portfolio?", and then the story begins....
What it does
First : A Multi-factor Fundamental Analysis Model User insert a stock ticker symbol, and click search, then BinaryStock will show the overall fundamental performance. This evaluates the stock based on a built multi-factor model with 5 attributes which are: i. Value ii.Growth iii.Liquidity iv. Trends v. Profitability
Second: Portfolio Optimization After searching a stock, user can add it into portfolio list. After few selections, user can build a portfolio, BinaryStock will then get user's risk preference and investment amount. There are 3 risk preferences: "highest return", "least risk" and "highest sharpe ratio", all of them are retrieved from the efficient frontier introduced by Harry Markowitz in his Modern Portfolio Theory. The graph is made up from 10000 random weightage combination of same stocks, using python (jupyter), it is visualized and attached in the screenshots.
Third: Portfolio Analysis Based on the suggested optimized portfolio, BinaryStock will make show the risk, sharpe ratio and return of it by calling BlackRock's api
How we built it
- A calculation is built and graph is plotted to find out the efficient frontier and optimal portfolio combination. This is constructed using python, it runs at our vps. (screenshot of plotted data is attached)
- We constructed a website and integrate the calculation into it.
Challenges we ran into
- Lack of market data. It took us very long time to find api that provide stock market data for free.
- Calculations are not accurate. Before this, we thought our calculation was ok, until we compare our result with BlackRock's result..... We turned out using approximate value
- BlackRock api doesn't provide consistent data, some columns are missing for certain portfolio (This will cause error to BinaryStock System).
- BlackRock api doesn't provide calculation, so we couldn't find out which part of our calculation leads to difference result with Blackrock api and fix it.
- Time limitation. We have to complete calculation and build a functional website within 24 hours, it is super rush!
Accomplishments that we're proud of
- Somehow we managed to build a multifactor model, we are so excited as it can be used for quantitative investment, but the model is not mature yet at the moment 2, To calculate the efficient frontier requires a large effort in studying the formula and understand some math concept behind it such as log return, covariance and etc. Yet we hacked it.
- We managed to polish our website to have a comfortable UI and UX.
- We managed to make a functional website with complex calculation (for us) within 24 hours.
- We even made it responsive! (for mobile devices)
What we learned
- Lots of finance stuff !!!
- UI and UX design skill improvement
- New skills: Blackrock api, python library such as numpy and pandas
What's next for BinaryStock
- Perform testing and check the true validity of each factor in model. This can be done by checking the covariance of log return and the factor.
- Fine tune the score calculation for stock, example: "P/B" score should not be strict for technology company. "ROA" should not be strict to Construction company.
- Make filter function so users can filter out the stocks they want from hundreds and thousands of stocks
- Macroeconomics and Technical Analysis should all included in the multi-factor model.
- Fix and enhance the calculation of Optimizing portfolio so it produce exact value instead of approximate value