RoboadvisorSystem
Robo-advisor
Install / Use
/learn @eleow/RoboadvisorSystemREADME
About
We propose a hybrid approach to portfolio managemnt, using traditional portfolio optimisation approaches as a baseline and augmenting portfolio performance using sentiments derived from Twitter. The usage of traditional portfolio optimisation as a backbone is advantageous as it is mostly familiar to investors and fund managers alike, and is easier to explain. By using Twitter sentiments as an insight into overall investor sentiments, we will also be pro-active towards potential market dips and spikes, and be able to increase our cumulative returns. An overview of the proposed approach, and the out-of-sample performance are shown below.


An end-to-end robo-advisor system is developed using Django, leveraging Django Edge v2.2. The list of portfolios is easily configurable from a spreadsheet, and includes SPDR sector ETFs, and All-Weather ETFs, SAW and SMPT portfolios. The overall user and system flows are shown below. As a prototype robo-advisor, it will only have the following core functionalities:
- Basic user management - sign up and log in,
- Summary page showing current account balance, earnings, portfolio as- set value, etc,
- Add and withdraw funds (virtual funds, no actual interface with real money),
- Portfolio management - Compare, buy and sell portfolios.

For more details, please refer to the complete paper here.
This repository can also be used to facilitate the experimentation of different portfolio algorithms. Refer to example Jupyter notebooks
Getting Started
Installation
-
Before cloning the repository, make sure you have git-lfs installed on your environment. The instructions to do so can be found here
-
If using Windows, install GNU Make to utilise make commands in the repo.
-
Then clone this repo:
git clone https://github.com/eleow/roboadvisorSystem.git
- For frontend code, install prerequisites in "requirements.txt"
- For backend code, install prerequisites in "\SystemCode\backend\requirements.txt"
- Note: zipline uses pandas==0.22.0 (Ignore warning about conflicts)
Usage
Robo-advisor system can be started by running the front-end Django server. Start the front-end by typing the following in your Anaconda environment, in the root directory of the repo
make front
Alternatively, if 'make' is not installed, then you can type the following
cd /d SystemCode/frontend/smartportfolioWeb/src
python manage.py runserver
Examples
Example usage of most backend functionalities can be found in the Jupyter Notebooks, Examples
Examples for Sentiment Analysis
Sentiment analysis example is found in the Jupyter Notebook, Sentiments
Tweets are obtained via "Twitter-Get-Old-Tweets-Scraper" using Jupyter Notebook, GetTwitterData.ipynb. Note that after retrieving a certain number of tweets (14000++), Twitter will block the request with "Sorry, die Anzahl deiner Anfragen ist begrenzt" which means "Sorry, the number of your requests is limited". Then just adjust argument "--until" with the earliest date where it failed and rerun the script after waiting for a while or with a different IP address, and save to a new file.
Examples for Portfolio Optimisation
Portfolio optimisation examples are found in the Jupyter Notebook, Portfolios.
Plot Markowitz bullet
Plotting the Markowitz bullet is a simple one-liner (using default settings) by just providing prices, which is a pandas DataFrame containing adjusted closing prices of the asset (each row is a date and each column is a ticker/id)
from utils import generate_markowitz_bullet
generate_markowitz_bullet(prices)
This will generate the following:
- Markowitz Efficient Frontier, represented by a dotted line
- Optimum portfolio based on maximum Sharpe ratio (red star)
- Optimum portfolio based on minimum volatility (green star)
- Random portfolios, plotted with color map applied based on Sharpe ratio

License
Distributed under the MIT License
Acknowledgements
Backtesting is performed using the Pythonic algorithmic trading library, Zipline
Markowitz optimisation and Hierarchical Risk Parity implementations are provided by PyPortfolioOpt
Genetic Algorithm implementation is provided by Distributed Evolutionary Algorithms in Python (DEAP)
Aesthetic style of plotting Markowitz bullet is borrowed from article by Ricky Kim
The front-end UI for the robo advisor system is built using the Django Web Framework
<div>Robot icon made by <a href="https://www.flaticon.com/authors/photo3idea-studio" title="photo3idea_studio">photo3idea_studio</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div> <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
Kiln
4.7kBuild, Evaluate, and Optimize AI Systems. Includes evals, RAG, agents, fine-tuning, synthetic data generation, dataset management, MCP, and more.
