Pssst, You! The original story is on Medium! Please read the article there and engage with it (clap, comment, and share!) It spreads my reach significantly. Thank you for your cooperation đ
|
Thus, I wanted to start another experiment at the same time, and show YOU EXACTLY how to generate a portfolio using AI that outperforms the market. This series will have at least two parts. This article will go over the process of creating, testing, optimizing, and deploying an AI-Generated Portfolio. The next article in the series will evaluate how the portfolio performed in real-time paper-trading.
|
I structured this article into five sections, each designed to guide you through the journey of creating and deploying a high-performance trading strategy using the power of AI and ChatGPT technology:
|
- Generating a Trading Strategy Using ChatGPT-Technology: Weâll start by exploring how to create a robust trading strategy leveraging the advanced capabilities of NexusTrade.
- Testing the Initial Performance of the AI-Generated Strategy: Once our strategy is in place, weâll evaluate its initial effectiveness.
- Optimizing the Strategy Using Powerful Genetic Algorithms: To enhance our strategy, weâll employ sophisticated genetic algorithms.
- Re-testing the Performance of Our AI-Generated Strategy: After optimization, we retest the strategy to measure improvements and adjustments.
- Deploying the Strategy Live to the Market with the Click of a Button: Finally, weâll bring our strategy to life in the real market. This seamless transition from theory to practice demonstrates the practicality and ease of use of our AI-driven trading solution.
|
The beauty of NexusTrade lies in its ability to demystify the complex world of trading. It empowers everyday investors with advanced tools for algorithmic trading, previously accessible only to Wall Street professionals. Whether youâre using a computer or a mobile device, NexusTradeâs intuitive design and powerful features make mastering the art of AI-driven trading a straightforward and rewarding experience. Dive in and discover how simple, easy, and effective it is.
|
Step 1: Generating a Trading Strategy Using AI
|
Asking Aurora, the AI Chat Assistant to Backtest the Portfolio
|
I typed the following strategies into the AI Chat (feel free to copy/paste).
|
Create a portfolio called âApple Mean Reversionâwith the following strategies. Give it an initial value of $25,000.
* Buy 5% of my portfolio value in AAPL when its price below its 30 day SMA â 1 SD and 2 days passed since the last AAPL purchase
* Buy 5% of my portfolio value in AAPL when its RSI is less than 30 and 2 days passed since the last AAPL purchase
* Buy 5% of my portfolio value in AAPL when its Rate of Change is less than (itâs 30 day SMA of its Rate of Change â 0.3 * 30 day AAPL SD) and 2 days passed since the last AAPL purchase
* Sell 25% of portfolio value in AAPL when its positions are up 8% and 14 days passed since the last sell
|
The chat works by utilizing a next-generation AI-Configuration Platform, NexusGenAI. NexusGenAI allows users to create sophisticated AI Applications with a no-code user interface. For more details on how NexusGenAI works, check out this article.
|
Step 2: Testing the Performance of the Strategy
|
After weâve generated a portfolio, itâs time to test the performance of that portfolio. We can do this by âbacktestingâ the portfolio as follows:
|
Asking Aurora to backtest the portfolio across the past two years
|
By clicking the âView Backtestâ button, we can see how this portfolio fared against buying and holding the S&P 500.
|
The backtest performance of this portfolio against SPY
|
This portfolio of trading strategies looks pretty good at first glance! However, how does it fare against buying and holding Apple? Letâs find out.
|
Asking Aurora to backtest the portfolio across the past two years using AAPL as the baseline
|
By asking Aurora to switch the baseline, we get the following results:
|
The backtest performance of this portfolio against AAPL
|
This portfolio does slightly worse than just simply buying and holding AAPL stock. How can we improve the performance?
|
Step 3: Optimizing the Portfolio using Genetic Algorithms
|
We can optimize the portfolio of trading strategies using genetic algorithms (GAs) directly within the app. Genetic algorithms are biologically-inspired AI Algorithms that can improve the performance of any arbitrary task. To utilize them in NexusTrade, click âView Portfolioâ and then scroll down until we see the âSaveâ button. Clicking it will save the portfolio to your profile.
|
The âSaveâ button when we view a portfolio
|
Click the âportfoliosâ button in the top-right corner, and then go to the Portfolio that we just created.
|
The Portfolio Dashboard for the âApple Mean Reversionâ portfolio
|
Click the âOptimizerâ button, set up your unique optimization configuration, and then click âSubmitâ.
|
The Optimization Dashboard that shows whatâs happening with our genetic optimization
|
The genetic optimization engine in our trading platform operates by fine-tuning the original trading strategies. It initiates this process by making subtle adjustments, followed by running extensive backtests. These backtests are critical as they continuously tweak the strategyâs parameters, aiming to enhance backtest performance according to predefined fitness functions set by the user.
|
Whatâs particularly fascinating about this process is its ability to generate not just one improved portfolio but an array of portfolios, each distinct in its performance characteristics. This variety means some portfolios may exhibit higher percentage gains but come with greater drawdown risks. In contrast, others might show moderate gains but boast higher Sharpe ratios and lower drawdowns. This diversity allows users to select a portfolio that aligns seamlessly with their unique investment objectives and risk tolerance.
|
Upon completion of the optimization process, users can explore various âOptimization Vectorsâ. These vectors present the specific changes made to the portfolio. Users have the flexibility to either update their current portfolio with these vectors or create an entirely new portfolio based on these refined strategies.
|
The âOptimization Vectorâ shows the exact change in our portfolio. We can choose to update our portfolio or create a new one
|
I decided to create a new portfolio, which redirected me to that portfolioâs dashboard.
|
Step 4: Testing the Optimized Portfolioâs Performance
|
The next critical step involved backtesting the newly optimized portfolio over the past two years. I utilized the advanced settings in the backtest configuration, allowing me to set the baseline asset to AAPL stock.
|
The Backtest Config for the past two years. Also using the Advanced Settings to set a new Baseline Asset
|
The results were promising. The optimization process appeared to have significantly enhanced the portfolioâs performance. The backtest results clearly showed that the newly optimized portfolio outperformed the original one, indicating a successful optimization.
|
The Backtest Performance of the newly optimized portfolio
|
Step 5: Deploying it live to the market.
|
Confident in the backtest results, I proceeded to deploy the portfolio live. This process is remarkably straightforward. By navigating to âSettingsâ, then âDeploymentâ, and selecting âStart Tradingâ, followed by saving the changes, the portfolio was deployed live.
|
Optimization Settings of the Portfolio
|
NexusTrade offers flexible deployment options, catering to different trading styles and strategies. For my portfolio, I chose to deploy the strategy for open and close market times. This decision was based on the aim to closely replicate the backtest performance.
|
In this article, I describe how to create, test, optimize, and deploy an algorithmic trading strategy using NexusTrade. The NexusTrade app makes this process extremely simple. Traders no longer have to worry about dealing with APIs and deployment; they can simply express their ideas in plain English, and then iterate upon them until theyâve generated a successful trading strategy.
|
The next article in this series will focus on how well the AI-Generated Portfolios do in the market. Live paper trading allows us to see how well our portfolios perform without risking any real capital. With this experiment, we can really see how well our AI-Generated Portfolios perform.
|
|