Pssst, You! The original story is on Medium! Please clap 50 times and share the article with a friend interested in investing, finance, or AI.
|
However, a mere three days ago, an unforeseen incident unfolded within the NexusTrade app. On the surface, everything appeared operational and seamless. Yet, lurking beneath this facade of normalcy was a bug— subtle yet disruptive. This unnoticed flaw insidiously wormed its way into the core of the app, resulting in a malfunction of the crucial live-trading mechanism.
|
This article intends not only to provide an update on the experiment but also to delve into the nature of this bug, its impact, and the ensuing ramifications for the portfolios.
|
Recap: The Genesis of the NexusTrade Experiment
|
I built NexusTrade, an AI-Powered automated trading platform. Amongst many powerful features, one of the things that made it stand out was its AI-Powered chat. For the first time in history, users with no technical expertise and limited investing experience could log onto an app and create sophisticated, configurable algorithmic trading strategies in a straight-forward manner.
|
After launching this incredible feature, curiosity got the best of me. How good of a trader would ChatGPT be if it was connected to such an app? I wanted to put the experiment to the test.
|
This experiment wasn’t confined to a single scenario. My objective was to explore the impact of various optimization parameters on the end results. Therefore, I created multiple portfolios to experiment with:
- An “un-optimized” portfolio crafted solely by ChatGPT.
- A portfolio initially optimized by GPT at the experiment’s inception.
- Two distinct GPT-generated portfolios, each undergoing periodic re-optimizations but with differing approaches.
- A benchmark portfolio employing the traditional “Buy and Hold SPY” strategy.
|
Current Performance: AI Portfolios Surpassing Market Expectations
|
The latest performance metrics of the AI-Generated Portfolios continue to affirm their market dominance, as observed in my last update. This past month has seen a robust surge in the market, with the TQQQ stock, a key component in these portfolios, achieving notable gains. Here’s a snapshot of how each portfolio has fared:
|
Buy and Hold Baseline Portfolio
|
Unoptimized ChatGPT-Generated Portfolio
|
One and Done Optimized Portfolio
|
Sliding Window Optimized Portfolio
|
Expanding Window Optimized Portfolio
|
The above graphics succinctly present the current standing of each portfolio in the experiment. These are not mere theoretical backtests; they represent the actual live-trading results in the market. The standout, “One and Done” Optimized Portfolio, continues its exceptional run with an 18.8% gain, dwarfing the S&P 500’s 4.7% increase in the same period. The unoptimized portfolio remains static, aligning with its historical trend of non-activity in trade execution.
|
As with previous updates, I have re-optimized the two dynamic portfolios. While I won’t delve into the details in this article, I encourage those interested in the re-optimization process to leave a comment below for more information.
|
Quick Note: Harness AI For Your Business
|
Many are yet to realize the transformative power of AI. NexusTrade’s Chat exemplifies this, automating complex workflows and elevating the user experience. NexusGenAI powers NexusTrade’s chat; it is a Generative AI Configuration Platform that makes it easy to build and maintain complex AI Applications. For businesses seeking AI integration, join the NexusGenAI waitlist.
|
The Unexpected Critter Crawling in NexusTrade
|
Introducing a Pivotal Functionality
|
In a stride towards enhancing user experience, I recently rolled out a pivotal update in NexusTrade: the ability to execute buy and sell orders directly from the User Interface. This shift from fully automated to semi-automated or even manual trading aligns NexusTrade with standard brokerage features, addressing a crucial need within any trading platform.
|
With the advent of orders becoming an application-facing entity, I introduced a slight update to the data model:
|
export interface IOrder { _id: Id; type: OrderTypeEnum; status: OrderStatusEnum; asset: AbstractAsset; userId: Id;
}
|
The addition of the userId field was a strategic decision. It serves as a security measure, ensuring that users can only access orders associated with their account. This design inherently enhances the application's security by preventing unauthorized access to other users' data.
|
Following the deployment of this feature, I undertook the task of backfilling the userId onto all pre-existing orders in the database, ensuring a smooth transition and maintaining the integrity of historical data.
|
The Moth Hiding in NexusTrade’s Relays
|
Post-deployment, NexusTrade functioned seemingly without a hitch. I was able to successfully test the new buy/sell feature on a test portfolio, which reinforced the belief that the integration was flawless. However, a peculiar observation arose after two days — a conspicuous absence of any trading activity. My initial curiosity led me to a startling discovery: all portfolios had been inadvertently undeployed!
|
The culprit behind this issue was the newly added userId field. While integrating this field, I had also implemented validation logic to ensure its presence. Because this field was missing in the production environment, it led to a silent failure of the application. This oversight resulted in the automatic undeployment of all active portfolios.
|
The automatic deactivation of portfolios upon encountering an error was a safety feature I had consciously embedded into NexusTrade. The rationale was to avoid the risk of portfolios operating under potentially erroneous conditions. An error message would be attached to the affected portfolio, followed by its deactivation. This mechanism was conceived during NexusTrade’s early days with around 200 users, and I overlooked the need to be notified in the event this scenario happens.
|
The Consequences: A Silent Disruption Across the Platform
|
The consequences of this change was that every portfolio that was currently deployed in the platform had silently been undeployed. The worst part is that my users wouldn’t even have noticed it!
|
That means, for two days of this experiment, my portfolios weren’t making any trades — not because the AI decided to not trade, but because the portfolios simply weren’t active.
|
Lessons Learned: Strengthening NexusTrade
|
Fortunately, this disruption could’ve been worse. The solution was straightforward — since the userId had already been backfilled, the remaining task was simply to re-deploy the portfolios. However, this incident served as a wake-up call, prompting several enhancements to the platform:
|
1. Enhanced User Interface for Error Notification
I log onto NexusTrade everyday and I didn’t notice this error because even though it was in the database, there were no indicators on the UI. I deduced there was a problem because of the lack of trading activity. If there was a visual indicator on the UI, I would’ve noticed it a lot faster.
|
2. Refining the Monitoring and Alerting System
While NexusTrade already boasts a robust monitoring and alerting framework, the recent incident shed light on a critical gap in my system. To address this, I have undertaken targeted enhancements to my existing infrastructure. The key improvement involves integrating specific alerts for scenarios like the one we encountered. This means that any similar errors in the future will trigger immediate notifications, not just to users who are affected, but also to me. This dual-layered notification approach is aimed at fostering rapid response and resolution, minimize potential disruptions, and increase transparency for my users.
|
No system can guarantee a 0% error rate. But by improving the monitoring and alerting of these errors, we can minimize the impact it has on a platform.
|
Conclusion: Steady Progress and Proactive Improvements
|
The journey with NexusTrade’s AI-Generated Portfolios has been a compelling blend of success and continuous enhancement. These portfolios, with their remarkable market performance, have demonstrated the potential of AI in transforming trading strategies. The recent introduction of a user-operated trading feature, while initially encountering a minor bug, was quickly rectified with no significant adverse effects. This episode led to the implementation of improved UI error indicators and more refined monitoring systems, reinforcing the platform’s robustness. Moving forward, these proactive steps affirm NexusTrade’s commitment to innovation and a seamless user experience in the evolving world of AI-driven trading.
|
|