For traditional investors, keeping a portfolio up-to-date (AKA rebalancing) is really hard work! I know from personal experience… I used to take hours every month to review old stocks, purchase new stocks, ensure correct weighting, review exposure and risk, etc. etc. It was really hard work and I really didn’t want a second job.
Luckily, for algo traders and quantitative investors, it’s easier; a lot easier! You utilize computers to do the whole process for you – saving hundreds of hours and ensuring you don’t sprout any (more) grey hairs.
In this article, we will look at how to rebalance an ’automated’ stock portfolio with Aikido in just a few minutes. Rebalancing a portfolio allows you to keep it up to date with the trading strategy that it’s based on.
I’m Shane; algo trader, FIRE enthusiast, and the founder of two quant startups.
So, let’s dive right in, let’s find out how you can rebalance your algorithmic trading portfolio today!
What is Portfolio Rebalancing?
Rebalancing your portfolio is an important part of managing your investments. Rebalancing means buying and selling positions in your portfolio to get back to your original asset allocation. When one asset class significantly outperforms another, your portfolio drifts from its starting allocation.
For stock-pickers, this can be a laborious process as the thesis you are following for your portfolio construction may not be very specific.
However for quants / algo-traders, this process is very structured and replicable. Here’s an overview of how to do it.
- Choose your portfolio weighting (at Aikido we use equal-weight as default)
- Choose your total portfolio value (including any additional contributions you will make)
- Compare you current portfolio to the screen of stocks that the algorithm currently outputs
- Sell some stocks and shares for securities that are no longer in the screen
- Buy some stocks and shares for securities that have entered the screen
Keeping a portfolio up-to-date is very important for quants and algo traders as it keeps the portfolio inline with the trading strategy. When a trading strategy is backtested, rebalancing can play a huge role in the variability of returns.
Bottom line: keep on top of rebalancing!
The good news: The whole process is automated with Aikido!
Before you get Started
Needless to say, before you can rebalance a portfolio, you must already have one created – if you haven’t already built an algorithmic trading portfolio you can do this easily with Aikido:
Simply pick a quant strategy, build a tracker portfolio and follow along in whichever broker you like. The algorithm shows you which stocks to purchase! You can read a full guide on how to build an ‘Automated’ algorithmic trading portfolio with Aikido here.
First, Ensure have connected Aikido with your Broker
From your Profile drop-down in the top right, click the ‘Connect Broker’ button.
You will be brought to the broker integration page, where you can connect your Interactive Brokers account.
For a full guide on how to connect your broker with Aikido, please read this article.
Navigate to your Portfolio and Click ‘Rebalance’
Once your broker is connected with Aikido, Navigate to the portfolio you want to rebalance and click the ‘Rebalance’ button in the portfolio overview pane on the left.
Note: The stock market must be open for you to be able to rebalance your portfolio (9:30am – 4pm EST).
Normally, you rebalance an Aikido algorithmic trading portfolio every month, quarter, or year; though you can rebalance at any time you like to keep your portfolio up to date.
Step 1: Add Cash
This optional step allows you to add an additional contribution (cash) to your portfolio. If you don’t want to add any more cash, you can click ‘Skip Step’
Step 2: Sell Stocks
This step show you the list of stocks and the number of shares which you will sell.
What’s going on in the background: The trading strategy algorithm compares your portfolio to the current strategy screen and runs an equal-weighting algorithm over the full portfolio. The list shown are all the stocks and shares that have left the screen.
You can simply click the ‘Confirm Orders’ button and the trades will be sent to your broker. You will see the status ‘Filled’ on each stock when they have executed successfully.
After you have worked your way through the list of stocks, click the ‘Next’ button to move on to the next step
Note: Aikido does not endorse or recommend any individual stock shown in this list; the stocks are purely generated by the algorithm.
Step 3: Buy Stocks
This step show you the list of stocks and the number of shares which you will need to buy.
It is identical to the previous step, but for buying securities rather than selling them.
Once again, you can simply click the ‘Confirm Orders’ button and the trades will be sent to your broker. You will see the status ‘Filled’ on each stock when they have executed successfully.
When you have taken action on each stock, click the button ‘View Portfolio’ button to finish the rebalancing process and go the the portfolio.
View your Portfolio
And that’s it! You’ve just rebalanced an algorithmic portfolio, nice job!
From Portfolio ‘Overview’ you can view performance, check out key metrics and view your holdings.
From the ‘Transactions’ tab you can view transaction level data (every buy or sell you have ever made). You can click a transaction row to edit it (eg. change the purchase price or the number of shares purchased). You can also click the ‘New Transaction’ to buy/sell a stock in the portfolio – you can add any publicly-traded company in the USA to the portfolio.
You will be notified when your next rebalance is due via email.
Auto-transactions & Gotchas
There are a few events which will trigger Aikido to automatically add a transaction to your Aikido portfolio. Those events are:
A delisting occurs when a stock is removed from an exchange, this can happen for a variety of reasons including mergers, liquidation, or even lawsuits. When this event occurs, your broker will automatically sell off the position for you – Aikido mirrors this event and adds a sell transaction to your portfolio to keep it inline with your broker. This means you could have some extra cash lying about in your broker – the next rebalance will fix this and bring your portfolio back up to the number of stocks it is supposed to have.
Note: In a situation where you own shares of company B, and B is a child company of A. If B merges with parent A, in some circumstances you will be issued stock of company A automatically by your broker. This event, while uncommon, is not mirrored by Aikido. If this event occurs you should sell the parent company A in your broker manually. Rebalance will then bring your portfolio up to date again.
A stock split is when a company increases the number of its outstanding shares to boost the stock’s liquidity. It brings the price of a individual stock down. When this event occurs, all shares of the stock are automatically sold and then the equivalent dollar amount is repurchased. These two transactions are added to your Aikido portfolio automatically.
Other corporate actions
Other corporate actions may not be tracked by Aikido. Rebalancing will sort most issues out, but if they persist – get in touch and we would be happy to help!
2% portfolio creation buffer
When creating and rebalancing your portfolio, Aikido leave 2% of the total portfolio value to the side to account for forseen and unforseen events. For example, if you are creating a portfolio with a total value of $1000, Aikido will not invest $20. That buffer will cover the cost of:
- Market volatility
- Currency conversion rates
- Transaction costs
- Other fees
Most of the 2% will not be spent and you will find the cash waiting patiently for you in your broker.
Strategy screen buffer
During rebalance your portfolio is compared to the current screen of stocks generated by the strategy algorithm. Stocks are bought and sold to stay in-line with the strategy. To reduce unnecessary churn (and thus fees) in the portfolio at rebalance, if a stock is within 1.5X the screen, it will remain in the portfolio. For example: You are using The Stable Dividend strategy and through the strategy you now own 10 shares of AAPL, along with 14 other companies to make up a 15 stock portfolio. At rebalance AAPL is no longer in the top 15 in the strategy screen but has moved to position 19. In this case you will NOT sell AAPL. However, had AAPL moved to position 29, you would have sold out of the stock completely.
Thanks for reading; happy trading!