How to deploy LLM-Powered Algorithmic Trading Agents?

Austin Starks
DataDrivenInvestor
Published in
7 min readMay 8, 2024

--

The Category 3 Trader, generated by DALL-E

I used to be a Category 1 trader.

In this world, there are 3 types of traders. Category 1 is The Uninformed Investor. This group of people often find their strategies online in forums like Reddit and TikTok. At best, they are gambling and at worst, they’re being scammed. Their “strategy” relies on luck, not analysis, and they consistently lose money by never learning from their mistakes. They rather blame “the Market Makers” for “rigging the market against them”.

Eventually, as I aimed to actually gain money with trading, I slowly became better at it. I became, what I call a Category 2 trader, aka a systematic trader. These are the types of folks that used to be WallStreetBets users, but have learned that following the mainstream opinion doesn’t work. These traders often maintain trade journals, reflecting on their decisions to improve future strategies. Embracing technology, they often use APIs for efficient trading. However, when faced with unpredictable market movements, emotions can still cloud their judgment, leading to panic-driven decisions and regret when the market eventually stabilizes.

Most traders quit after this stage because they are still unprofitable. But those that make it through evolve to the final category of traders: Category 3: the algorithmic trader. This trader doesn’t just use computers to execute their trades; they use computers to formulate them. They understand strategy optimization, how to prevent overfitting, and how to make generalizable trading strategies. They understand that the best way to beat the market is to have a rigorous systematic approach.

They also use tools to make this approach easier. For example, they utilize “backtesting”, a way of simulating past historical returns, to confirm their hypothesis, and then paper-trade after they think they’ve developed an edge. When their portfolio drops suddenly, they don’t panic, because they understand that it’s mathematically impossible to win every single trade. These are the traders who are profitable when the year ends.

There’s a common misconception that you have to be a MIT PhD student to become an algorithmic trader. But this is far from true. Thanks to the advent of Large Language Models, anybody with a computer and wifi and learn to become an algorithmic trader. This is even more true now than ever, with the advent of LLM-Powered Trading Agents.

What is an agent?

An LLM (Large Language Model) Agent is an AI system that combines the natural language understanding and generation capabilities of LLMs with additional abilities to gather information, take actions, and interact with its environment to complete tasks. LLM Agents can engage in goal-directed behavior to assist users, solve problems, and make decisions.​​​​​​​​​​​​​​​​

My theory is that LLM Agents can make algorithmic trading accessible to the average person. The agent can give a trader a list of testable ideas, help evaluate their strategies, and guide them through the process by utilizing paper-trading, the ability to trade with “monopoly money”.

The End Goal for An LLM-Powered Financial Agent

My goal is to integrate AI Agents into my algorithmic trading platform, and make them accessible for retail investors who otherwise would not have access to this type of platform.

To do this, I’m building NexusTrade.io, an AI-Powered algorithmic trading platform. NexusTrade offers a comprehensive set of tools that enables users to research trading ideas, create trading strategies, optimize their algorithms, and deploy them live to the market. An entry-point to many of these advanced features is Aurora.

Aurora, the AI Trading Copilot

Right now, Aurora is capable of generating trading strategies, helping with financial research, and deploying backtests. For an agent, these would be some of the actions that she’s capable of executing. And, for expanding her functionality to make her an official “AI Agent”, there are 2 approaches that I could consider: the semi-automated approach, and the fully-automated approach.

Semi-Automated Approach

My vision is creating an agent that helps the trader make decisions in the market. Before the market opens, Aurora can analyze the stocks on the watchlist. She can fetch relevant news for those stocks, see if they had a recent earnings, or check if there was a recent large change in price. She can then send you a list of optimized portfolios, that have worked out-of-sample in other similar environments.

This functionality would enable Aurora to function similar to how GitHub Copilot functions for software engineers. She won’t replace the trader entirely, but rather augments their abilities. The better you are at trading and the more comfortable you are approaching the market, the more use you will get from her. An extremely talented trader can research more ideas simultaneously, evaluate them more critically, and create a larger repository of agents that can do several different things.

Fully-Autonomous Trading Agents

While the semi-automated approach offers many benefits, another exciting possibility is the development of fully-autonomous trading agents. If the semi-automated approach is akin to Copilot, the fully-autonomous approach is similar to Devin, the world’s first AI agent for software development. With the fully automated approach, we would instead give an agent a goal and a set of hypotheses, and have the agent iteratively and autonomously find the best strategies with those ideas.

To implement this, we could use an LLM-framework like ReAct, and create an agent that is capable of using the tools available automatically, to get closer to obtaining the user’s goals.

We could also experiment with utilizing algorithms such as retrieval-augmented-generation, model-based reinforcement learning, and LLM-based RL algorithms such as the Decision Transformer.

Evaluating the Risks of Deploying LLM Agents

Despite the potential of AI-powered trading agents, it’s essential to consider the risks and challenges associated with their implementation. There are things such as cost, the potential for the AI to be stuck in a loop, the failure to consider factors outside of the platform, and the risk of deploying these systems are all factors that need to be considered.

If the semi-automated approach is like Cipilot, the fully autonomous approach is like Devin. However, like Devin, there are several more drawbacks to the fully autonomous approach. While semi-automated agents can foreseeable be deployed to users before the end of the summer (due to the reduce likelihood of them going completely off-the-rails and racking up huge costs), fully autonomous agents will likely be limited to paper-trading for at least the end of the year. Nonetheless, evaluating how these types of agents perform in real-time paper-trading would be an extremely interesting experiment.

Conclusion

The financial industry is on the cusp of a significant transformation, as artificial intelligence and AI-powered agents begin to demonstrate their potential in the realm of trading. While theoretical applications like FinGPT have garnered attention, there is a notable lack of practical implementations. NexusTrade.io is at the forefront of this change, well-positioned to bridge the gap between theory and practice by developing and deploying semi-automated and fully-autonomous trading agents.

However, it is crucial to acknowledge the risks and challenges associated with AI-powered trading agents. Agents may encounter feedback loops, leading to costly errors and inefficiencies. Moreover, their inability to evaluate stocks based on factors outside their programmed environment can limit their effectiveness, as real-world events such as tweets or breaking news can significantly impact the stock market. Recognizing and addressing these risks is essential for the responsible implementation of AI in trading.

Despite these challenges, AI-powered trading agents offer immense value, particularly for experienced traders seeking to enhance their strategies and decision-making processes. NexusTrade.io aims to democratize access to these advanced tools, empowering the average investor to become a category 3 trader and compete in an increasingly complex financial landscape.

As the adoption of AI in trading accelerates, we can expect a surge in innovative applications and use cases. The potential for AI to revolutionize the financial industry is immense, and NexusTrade.io is at the vanguard of this exciting development. By staying informed, embracing responsible implementation, and continuously refining these cutting-edge technologies, we can unlock new opportunities and redefine the future of trading.

--

--

https://nexustrade.io/ Highly technical and ambitious. Building a no-code algotrading platform and an ecosystem of AI applications. https://nexusgenai.io