Open source robo advisor
360
Robo advisors are automated advising services that require little to no user interaction. They specialize in maintaining portfolios based on the investors chosen risk level. The first robo-advisor was launched at the start of the financial crisis in 2008.
The logic for a robo-advisor takes place in 3 stages:
At this point, the robo-advisor does not use mean-variance optimization to allocate. The risk-based weight allocation is taken from this set of Vanguard Portfolios. Each series its individual universe.
The src files in the repo contain a robo advisor in three distinct stages.
If you're interested in running the code locally, there are dependencies to install, and steps to take.
You can find OS-specific installation instructions for zipline here. I'm going to second their recommendation to run zipline in either a virtual environment. You can find installation instructions for the alpaca-trade-api here.
To ingest the bundle. Run the following command after cloning the repository:
$cd setup
$./setup.sh
If you're interested in running backtesting in a docker container, this repository is configured to do so. Running the following commands will create and launch a docker images that has all necessary dependencies installed, as well as the alpaca bundle ingested.
$git clone https://github.com/alpacahq/roboadvisor.git
$cd roboadvisor.git
$docker build -t alpaca/roboadvisor .
$docker run -it alpaca/roboadvisor bash
If executed properly, you'll see the following in your terminal:
$docker run -it alpaca/roboadvisor bash
$root@b2cefad654cf:/home/robo-advisor#
You can then run the algorithm you want using the command:
$zipline run -f <filename> -b alpaca --start 2018-01-01 --end 2018-06-01
If you're interested in running your own algorithm using the data the Alpaca bundle provides (ETFs among others), simply add the file containing your algorithm to the folder, and rebuild the docker image using the docker build command. If you use the same name (alpaca/roboadvisor), the previous image will be overwritten.
If you're interested in the creation process of a roboadvisor, there are a series of posts on hackernoon regarding this robo-advisor:
Content type
Image
Digest
Size
1.1 GB
Last updated
about 8 years ago
docker pull alpacamarkets/roboadvisor