How I built an AI that magically rebalances your portfolio
Imagine Executing a Dozen Trades With the Click of a Button
Everybody has heard of “the Magnificent 7”.
You don’t have to be a finance bro to know that these are some of the best stocks in the world. They include tech giants like NVIDIA, Google, and Tesla that have seen outsized returns across the past decade. These stocks also happen to be the leaders of the Artificial Intelligence revolution.
And yet, most people don’t invest in them.
The reasons why are pretty obvious. Nobody knows when is the best time to start selling off some of your shares and buying more. Nobody wants to do all of that work. So they choose boring ETFs like SPY and VOO instead.
But what if there was a way to automatically invest in some of the best stocks in the market?
I built an AI that does this. Give me 3 minutes and I’ll demonstrate its power.
An Insanely Powerful Rebalancing Tool
Before I start, I want to say something fairly obvious…
You don’t need an AI to buy and hold stocks.
If your goal is just to buy the Magnificent 7, hold them for the long-run, and never rebalance your allocations, you can do that fairly quickly with any brokerage app. You don’t need any specialized tools; with just the click of few buttons, you’ll have a fairly successful strategy on your hand.
Zoom image will be displayed The Backtest Performance of Buying and Holding the Magnificent 7 – it’s up 351% in the past 5 years vs SPY’s 106%But if your goal is to run simulations or change the allocations of your portfolio dynamically across time, you’re SOL, especially for a complex strategy. For example, let’s say you wanted to test out or deploy a strategy that rebalances these 7 stocks, but weighted by the log of their PE ratio. Unless you’re willing to:
- Pull a calculator out
- Calculate the exact amount of shares you would have to buy and sell
- Execute a dozen manual orders every week
Then you’re not going to do this. It’s impractical for the vast majority of people.
With AI, you can now do this with the click of a button.
Zoom image will be displayed With AI, you can create an algorithmic trading strategy that automatically rebalances a portfolioHow Does the AI Work?
This is all possible with NexusTrade, my free, AI-Powered algorithmic trading platform.
The AI that powers all of this is a large language model. It works by converting plain English into a “trading strategy configuration”.
Zoom image will be displayed A Diagram Depicting the Process of Creating a Portfolio of Trading Strategies. We get the prompt, create the portfolio outline, create each individual strategy (including the action and the condition), and then assemble the fully generated portfolioThe AI generates a configuration containing a portfolio, the list of strategies, and the actions and conditions within each strategy. On the UI, it looks like the following screenshot.
Zoom image will be displayed The trading strategy configuration generated by the AI modelThese configurations has rules for when to buy, sell, alert, and even rebalance a portfolio. We can control the exact conditions and the actions in the strategy. Maybe we want to trigger the rebalance when any of these stocks have a significant change in P/E ratio. Or, we want to initiate the rebalance every single day. All of this is controllable using natural language.
More than that, we can test to see how these rules perform during any period in the past — a process called backtesting. We can also deploy these rules live using a brokerage like Tradestation to automatically execute trades.
While backtesting and paper trading are fully automated, the platform incorporates additional safeguards for live trading to ensure you have the final say. For your financial safety, the system sends an alert with the trades 100% ready for execution. All it needs is our final approval.
Zoom image will be displayed The email sent to a user by the system; it has the exact allocations and a button that says “View in Portfolio”When we click “View in Portfolio”, a modal will pop-up that reiterates our new portfolio allocations. If we’re ready to trade, we’ll click “Confirm Portfolio Rebalance” to execute the trades.
Zoom image will be displayed The allocations in our portfolio will be 16.7% each after the rebalanceThe above screenshot shows a relatively simple strategy where we’re rebalancing by equal weight. However, we can choose to do something far more complex.
For example, if we ask the AI to create a strategy that rebalances based on the log of their PE ratio, it will compute the metric, sum the logs, and divide each stock’s value by the sum… all of this behind the scenes, while you see the final allocations.
Zoom image will be displayed A screenshot of the review order screen when the AI creates a strategy based on the log of their PE ratioNot only can we execute all of the trades, including the buying and selling, with the click of a button, but we can also simulate how this exact strategy performed in the past, just as easily.
I just typed “backtest across the past 5 years”, and in less than a minute, I know that this strategy earned 341% in the past 5 years (compared to SPY’s 106%).
Zoom image will be displayed The backtest performance of this complex rebalancing strategy from August 4th 2020 to August 4th 2025If we click the graph, we get even more information. We see metrics like sharpe ratio, sortino ratio, and drawdown. We can see that this particular strategy has a roughly equivalent sharpe ratio, a higher drawdown, and a much higher percent change than holding SPY, making it perfect for risk-hungry tech bros who believe in the future of artificial intelligence.
A side-by-side comparison of this strategy’s performance vs holding SPY stockAll of these metrics, simulations, and evaluations without costing you a dollar. That’s pretty crazy!
Concluding Thoughts
I’m not claiming that this AI will make you a millionaire overnight. We haven’t begun to talk about hindsight bias, survivorship bias, or overfitting.
But in comparison to executing dozens of manual trades, the difference is legitimately night and day.
Not only can you test out fairly complex trading strategies, but you can do so using natural language. You don’t need a finance background or software engineering skills to get started.
If you ever thought about making more money as a trader or long-term investor, now is the perfect time to get started. Imagine being able to test your wildest ideas within minutes. No wrestling APIs or debugging Python.
Just plain English. If you can read and write, the sky is the limit.
Don’t believe me? Spend 5 minutes of your day to just try it for yourself. Getting started is free.