Using OpenAI’s o1 Model to Develop a Trading Strategy That Outperforms the Market
The new OpenAI o1 model, code-named “strawberry,” recently demonstrated its potential for creating a successful algorithmic trading strategy. Although it processes information more slowly than many previous large language models, this extra time—often referred to as “thinking”—appears to yield highly profitable results. In fact, early experimentation suggests that even a first attempt at using this model can produce a market-beating portfolio.
The Accidental Discovery of a High-Performing Strategy
An AI-driven trading platform known as NexusTrade was employed to integrate various Large Language Models (LLMs), including both open-source options and proprietary models like those from OpenAI. The platform’s workflow involves:
- Message Sending: A user input is sent to a server.
- Request Classification: The system identifies which type of prompt (e.g., stock screener, portfolio creation, fundamentals analysis) is most relevant.
- Prompt Processing: The message is forwarded to the chosen prompt, and a response is generated.
- Post-Processing: For a prompt like “AI Stock Screener,” the response is turned into a SQL query that is then executed to produce actionable results.
When the user specifically requests to develop a trading strategy, NexusTrade creates a “prompt chain.” This involves:
- Portfolio Setup: Assigning a name (e.g., “Omni”), an initial investment amount, and a general strategy description.
- Strategy Outline: Specifying the asset, action (buy or sell), volume or percentage of capital, and triggers for buying or selling.
- Translation into Executable Rules: Converting the descriptive strategy into conditions that NexusTrade can run for backtesting and live trading.
Previously, older LLMs required very explicit user instructions. The new “strawberry” model (OpenAI o1), however, spontaneously generated its own highly profitable trading ideas on the first attempt.
Comparing GPT-4 and OpenAI’s o1 for Portfolio Creation
A test was conducted to build an algorithmic trading portfolio using GPT-4. The user asked for a Simple Moving Average (SMA) crossover strategy on TQQQ (a leveraged tech ETF), plus a profit-taking strategy without stop losses. GPT-4 produced a portfolio that, according to backtests, did not significantly outperform a standard market index and triggered excessive trades—likely generating additional costs and taxes.
Using the exact same request, the OpenAI o1 model generated a substantially more profitable strategy from the start. In a backtest:
- Total Return: Approximately 268%—roughly triple the S&P 500 benchmark over the same period.
- Sharpe Ratio: 0.71 vs. 0.51 for the index, indicating a more favorable risk-adjusted return.
- Drawdown: A max drawdown of 37% (versus 34% for the S&P 500) but with a lower average drawdown of about 4.35%, compared to nearly 7% for the index.
These numbers suggest that, at least in backtesting, the o1 model produced a strategy with both higher returns and lower average risk.
Why Did o1 Outperform GPT-4 Initially?
A closer look revealed a key difference in the sell trigger:
- GPT-4: Suggested selling upon achieving a minimal profit target (around 0.15%), which led to frequent, shallow gains and numerous trades.
- o1 (strawberry): Opted for a more ambitious exit trigger, selling only if a 14-day average price rose by 15% or more. This approach captured more substantial price moves.
Once GPT-4 was nudged to hold positions longer, it also achieved strong results. This indicates that GPT-4 can still produce market-beating strategies, but it may require additional refinement or iterative feedback.
Moving from Backtests to Live Trading
While backtesting offers insights into how a strategy might have performed historically, actual market conditions are fluid and unpredictable. To validate these AI-generated portfolios, NexusTrade will deploy them in live market conditions. Observing real-time performance will reveal whether the successes indicated by historical data carry over to current market scenarios.
Concluding Thoughts
Artificial intelligence is set to revolutionize many industries, and finance is no exception. Both GPT-4 and the o1 model can assist traders in devising effective algorithmic strategies within minutes. The o1 model stands out for generating a highly profitable approach with minimal user guidance.
However, backtesting alone does not guarantee future success. Ongoing live testing will show whether these AI-constructed portfolios maintain their advantage in changing market environments. Regardless of the outcome, this experiment highlights the potential role of AI in enhancing investment decisions and underscores the need for ongoing evaluation, risk management, and human oversight.
External References
- https://openai.com/blog
- https://www.quantstart.com/articles/Algorithmic-Trading-Strategies/
- https://www.investopedia.com/terms/b/backtesting.asp
- https://www.sec.gov/investor/pubs/askquestions.htm
- https://www.forbes.com/finance/
- https://nexustrade.io