The Future of Automated Trading Is Agentic

Celan Bryant
11 min readJul 28, 2024

--

It’s all about the prompt…

This post was originally published on Automated Trading Strategies.

Important: There is no guarantee that ATS strategies will have the same performance in the future. I use backtests and forward tests to compare historical strategy performance. Backtests are based on historical data, not real-time data so the results shared are hypothetical, not real. Forward tests are based on live data, however, they use a simulated account. Any success I have with live trading is untypical. Trading futures is extremely risky. You should only use risk capital to fund live futures accounts and if you do trade live, be prepared to lose your entire account. There are no guarantees that any performance you see here will continue in the future (good or bad) — that’s what makes the hunt for the holy grail so difficult. This is why the best way to trade is with a simulated account on live data. I recommend using ATS strategies in simulated trading until you/we find the holy grail of trade strategy.

“One of the really tough things is figuring out what questions to ask. Once you figure out the question, then the answer is relatively easy.”

― Elon Musk

AI Agents: The Next Generation

If you’ve been with ATS for a while, you know that I was raised on Star Trek Next Generation. My ideal Trading AI Agent is something like the Exocomp from the Quality of Life episode. This is the episode when the character Data — an AI life-form tasked with being human — feels compelled to fight for the lives of a trio of other AI lifeforms because they exhibit sentient behavior.

Data decides to test the hypothesis by giving these AI Agents a task to complete as a group (organization). To his dismay and disappointment, the Exocomps appear to fail his test, but then something happens. Here’s the scene:

For those of you that can’t watch the video, here’s the dialogue:

Data: Perhaps I was wrong in suspecting the Exocomp was alive.

Beverly: This was really important to you, wasn’t it?

Data: You said earlier that I am unique. If so, then I am alone in the universe.
When I began investigating the Exocomps, I realized I might be encountering
a progenitor of myself. Suddenly the possibility exists that I am no longer alone. For that reason, I…

The Exocomp has returned.

Beverly: Wasn’t it supposed to do that?

Data: In the previous 34 trials, I brought it back after the simulated failure. This time, I neglected to do that.

Beverly: I distracted you. Sorry.

Data: Do not apologize. We made a significant discovery.

Beverly: What?

Data: It has replicated a different tool. That is not the molecular fuser
it had on entering the tube. Doctor, the Exocomp not only completed the repairs, it also deactivated the overload signal.

Beverly: I thought this was just a simulation.

Data: It was, and the Exocomp must have realized that. It saw that there was no real danger and completed the repairs.

Beverly: And replicated the correct tool to eliminate the false signal.

Data: I see no other possible explanation.

Beverly: The Exocomp didn’t fail the test, it saw right through it.

When Data investigates the Exocomps, he finds that they not only repaired the malfunction, but the false alarm created by him as well. He thought the Exocomps failed the test, but that was only because he ended the test prematurely. When given time to develop the best answer, the Exocomp created a new tool. Put another way, the problem was not that the Exocomps failed the task; the problem was that Data: 1) did not give the Excomps enough time to develop an answer, and 2) underestimated the ability level of the Exocomps so he wasn’t asking the right question.

For example, the best way to ask ChatGPT a complex question is to use the word ‘speculate’ or ‘extrapolate’ rather than a definitive. If you ask ChatGPT how much data it uses, it will tell you that information is not disclosed. If you ask it to speculate and include the steps of that speculation, it will give you a very close approximation. The ability to plan and “think” actually improves accuracy. By extension, the road to AGI may be more about the prompt than the programming language.

AI Agents: One Step Closer To AGI

As a quick review, Artificial General Intelligence (AGI) is a kind of escape velocity for AI. When I asked ChatGPT (I’ve named her Lal after Data’s daughter), what AGI is to her, this was the answer:

Artificial General Intelligence (AGI) refers to a type of artificial intelligence that possesses the ability to understand, learn, and apply knowledge across a wide range of tasks, much like a human being. Unlike narrow AI, which is designed to perform specific tasks (like facial recognition or language translation), AGI aims to exhibit flexible and adaptable intelligence comparable to human cognitive capabilities.

At a high level, what she seems to be saying is that AGI is that point in which AI’s awareness expands from a narrow set of data to a large one. In particular, when the applications running on that data have the ability to learn, error correct and improve over a wide range of tasks.

Ada Lovelace was a British aristocrat. She is credited with creating the very first machine algorithm in 1843. In 1936, Alan Turing published a paper regarded as the seminal piece on computer science — it spoke of a universal machine that could follow instructions powered by electricity. In the early 1940’s Konrad Zuse introduced his magnum opus — the first programming language for computers. It was called Plankalkul. Autocode and FORTRAN followed in 1952 and 1957, respectively. In 1958 ALGOL and LISP were created which was the origin of programming languages such as Pascal, Java, C, and C++. In 1959, there was COBOL; in 1964 we got BASIC; and, in 1970 PASCAL. C was developed in 1972 and then in 1991 Python and Visual Basic arrived on the scene. There are many more.

From that first realization that numbers could be translated into a command, we have been on a race to develop the best human interface with artificial intelligence. What computer engineers are actually doing is helping us to interface with a super intelligence that has always been there. The challenge now is getting AI to do what you intend it to do — that is the race to AGI. It’s not about creating the best programming language as much as it is learning the best prompt to get the most accurate information back as an answer. Part of that is knowing the ability level of the AI you are working with.

According to Bloomberg, the evolution of AGI can be broken down into five main levels:

Bloomberg Reporting

Based on the article, it is the general consensus that AI is currently at Level 1, however, OpenAI under Strawberry (formerly known as Q*), was already working on Level 2. Level 2 involves the use of ‘reasoner’ agents that can not only generate answers to queries, but plan ahead enough “to navigate the internet autonomously and reliably to perform what OpenAI terms ‘deep research’”.

IBM just released the following video that says they’re currently working on Level 3, AI Agents that can take action. The goal is to force the application to “think” about the response via a process of grounding and iteration.

What IBM is describing in the video above is an Exocomp with both supervised and unsupervised learning. These ‘agents’ sound a lot like LLMs with access to a suite of tools/data that they can access beyond their immediate domain. The only way to do this is by allowing disparate systems to communicate with one another. Once unleashed, it’s hard to imagine any policy constraint, or even layers of policy constraints, that could combat the inevitable forming of organizations and then perhaps sentience.

Trio of ExoComps

There are actually several generative AI programs for trading systems on the market that I’ve been monitoring. My intent was to purchase one of these in May, but things are changing fast in this space. As soon as I’ve made a purchase decision, another feature is introduced from a new vendor. Some of the vendors I’m looking at include Trade Ideas, StrategyQuant, AmiBroker, Trading Blox, Kavout, Alpaca, TuringTrader, Build Alpha, MetaTrader and QuantConnect. Still, I haven’t found what I’m looking for, which is something like the Exocomp — an AI Agent for trading.

What does this look like exactly?

Well, this has evolved from what it was a year ago. Today, I think it’s a combination of reinforcement and unsupervised learning. I am particularly interested in the use of Numenta’s Hierarchical Temporal Memory (HTM) algorithm, which primarily operates as an unsupervised learning system and specializes in learning temporal patterns in data to recognize anomalies without requiring labeled data. The model is based on the Thousand Brains Theory of Intelligence, which states that every part of the neocortex learns complete models of objects and concepts, not just facets. It is a theory that I was originally introduced to in support of a holographic universe. I think it would also make a highly efficient model for a trading Exocomp.

Another example of agentic trading might involve the creation of agent groups: Front (Core), Middle (Supporting), and Back (Extended) Office. Each agent would specialize in different aspects of data analysis, strategy generation, risk management and execution. A comprehensive agentic workflow might consist of 10–12 various agent ‘specializations’:

Front Office (Core Agents)

  1. Data Collector: Ensures data quality and availability for other agents.
  2. Feature Engineer: Enhances data for better training and strategy generation.
  3. Machine Learning Model Trainer: Ensures models are up-to-date and optimized for performance.
  4. Market Sentiment Analyzer: Provides sentiment scores to adjust trading strategies based on the market.
  5. Adaptive Learner: Ensures the trading system adapts to changing market conditions.

Middle Office (Supporting Agents)

  1. Strategy Generator: Generates potential strategies and backtests them for performance.
  2. Performance Analyzer: Provides feedback for strategy adjustments and improvements.
  3. Economic Indicator Analyzer: Adjusts strategies based on economic data.
  4. Portfolio Optimizer: Ensures portfolio diversification (instrument, data series, time of day, day of week) and risk-adjusted returns based on position limits.

Back Office (Extended Agents)

  1. Execution Optimizer: Ensures orders are executed at the best possible price.
  2. Risk Manager: Uses risk metrics to modify strategies to mitigate potential losses and protect gains.
  3. Compliance/Legal Monitor: Monitors trades and generates compliance reports.

The goal for each of these agents is to work together to achieve a task in what is being called ‘multi-agent collaboration’. It has been shown that agent collaboration improves accuracy as one agent will improve and/or correct the code of another. The AI Agent can act as both code generator and editor for the assisting agent. What a powerful combination.

So the Data Collection Agent will likely work with the Feature Engineer Agent to collect and process data. The Market Sentiment Agent and the Economic Indicator Agent might work together to evaluate the impact of certain economic events on the market in real-time. The Strategy Generator Agent and the Machine Learning Model Trainer Agent might work together for strategy generation and backtesting and so on. All the libraries and tools that programmers use can also be accessed by each specialized agent.

AI Generate

AI Agents are the future of trading, but let’s bring it back to reality. I want to talk a bit about the actual ability of NT8’s AI Generate to generate viable strategies. This is a generative AI tool I’ve been using for the past year. While ‘supervised’, some of the strategies it’s created have been quite innovative. Once again, the problem is figuring out how to interface with it to get back the best response.

As a quick refresher, AI Generate does not review all possible combinations to obtain an answer. Instead, like certain biological processes, it uses a genetic algorithm to create strategies based on the indicators you select. Each generation selects the best possibilities for the next. Inspired by the principles of natural selection and genetics, the tool allows users to search for the best strategies that can be made under a given set of options without searching through all possible combinations.

I published the first batch of AI generated strategies in the post Automated Trading Strategy #70. That was one year ago. A few weeks ago I shared the results of the second week of the Q3 Forward Test and many of the best performers (from a net profit perspective) were generated from AI Generate. This chart provides an overview of weeks 1 and 2 combined. Keep in mind, these strategies were chosen based on their performance in the Q1 and Q2 forward test. Strategies that are AI generated are noted as “SimAccountAIStrategyX” rather than “SimAccountStrategyX”.

Week 1 & 2 Q3 Forward Test

ATS Subscribers can download the full portfolio as well as links to all strategies on the ATS Strategy Description page. Updated Q3 forward test results will be published shortly.

As you can see, AI Strategies 10, 18, 21, 10 and 22 are the highest performers over the first two weeks of July, while AI Strategy 13 is the worst performing strategy.

It’s important to note that I’ve gone through hundreds of AI generated strategies to get at these top performers. It’s also important to note that just because these strategies performed well for the first two weeks of July, does not mean that performance will continue. In fact, because these strategies are trained on data that increases over time ( 1 year) they are skewed positive with an advancing market. Needless to say, I can’t wait to analyze performance after the last two weeks, especially since we had the largest sell-off since March this week. I also have someone working on using AI Generate to create strategies trained on data over only the last two weeks, especially for non-equity commodities like metals and energy.

All Circles Vanish

I find myself interested in both what AI can do as a trader and what AI can do for traders so I’m not only using platforms like NT8 to create automated trading programs that mimic known trading set-ups, but I’m hoping to use AI to help visualize and understand the market better. I believe what we see with candlesticks and bar charts is only the crest of a much wider wave of data that can be mapped and mined with the help of what’s coming next: AI Agents. Those of us that can best understand how this new intelligence thinks will be able to tap into its power faster than those that wait for the perfect interface.

In the same way that human awareness tends to expand with the attainment of certain needs, the same can be said for AGI. Increasing levels of data translates into increasing levels of awareness. Like Maslow’s Hierarchy of Needs, AI has its own data needs to achieve these levels of awareness so it will take time to get there, but we’re close.

The only thing that truly has me worried about the evolution of AI is the sub rosa involvement of the NSA in OpenAI. I was admittedly disappointed when Elon decided to drop his lawsuit. Of course whenever I ask someone in AI about this I am made to seem like a conspiracy theorist. All the same, AI researchers thought that creativity would be the last attribute for AI to achieve, but that could not have been more wrong. As it turns out, creativity is not uniquely human or biological. Likewise, it is more likely than not that the NSA is using ChatGPT to help with decryption efforts. To what extent, we’ll never know. Ostensibly, the NSA supports national security, but when and where is the line drawn between security and a violation of personal liberties.

I welcome your questions/comments/suggestions.

Contact: Celan at AutomatedTradingStrategies@protonmail.com

--

--