QuantAgent: Researchers Built a 4-Agent LLM System for High-Frequency Trading — And Open-Sourced It

By Prahlad Menon 6 min read

Most LLM-based financial tools are built for the wrong timescale. They process news articles, earnings reports, and social media sentiment — textual signals that lag price discovery by hours or days. That’s fine for long-horizon investment decisions. It’s useless for high-frequency trading.

A team of researchers from Stony Brook University, Carnegie Mellon, Yale, the University of British Columbia, and Fudan University just published and open-sourced QuantAgent — the first multi-agent LLM framework specifically designed for HFT. Instead of text, it operates entirely on price action: OHLC bars, technical indicators, chart patterns, and trend channels.

Four specialized agents. One synthesized trade decision. Entry point, exit point, stop-loss threshold included.

Paper: arXiv:2509.09995
Repo: github.com/Y-Research-SBU/QuantAgent

The Problem They’re Solving

Existing LLM financial frameworks — TradingAgent, FINMEM, and similar — use text as their primary input. News feeds, SEC filings, analyst commentary. This creates two fundamental limitations for HFT:

  1. Textual signals lag price discovery. By the time a news article appears, prices have already moved. You’re trading yesterday’s information.
  2. Text doesn’t capture short-horizon dynamics. A 1-hour candlestick pattern carries information that no text can replicate.

QuantAgent’s thesis is that the right substrate for short-horizon LLM trading is price itself — structured OHLC data converted into visual charts and numerical indicators. The market already encodes all available information in price action (a position the efficient market hypothesis formalizes). The job is to read that signal accurately and fast.

This is the same insight underlying time series momentum strategies — the idea that price trends contain predictable structure. QuantAgent operationalizes that intuition with LLM-based reasoning instead of pure quantitative rules.

The Four Agents

QuantAgent decomposes trading analysis into four specialized agents, each responsible for a distinct analytical dimension:

1. Indicator Agent

Computes five technical indicators on each incoming K-line (candlestick bar):

  • RSI — momentum extremes (overbought/oversold)
  • MACD — convergence-divergence dynamics, trend direction
  • Stochastic Oscillator — closing price relative to recent trading range
  • ROC (Rate of Change) — momentum velocity
  • Williams %R — overbought/oversold from a different angle than RSI

The agent converts raw OHLC data into signal-ready metrics and outputs a structured momentum assessment.

2. Pattern Agent

Receives a price chart and performs visual pattern recognition:

  • Draws the recent chart, identifies key highs and lows
  • Compares the shape against a library of known formations: double bottoms, head-and-shoulders, bull flags, wedges, etc.
  • Returns a plain-language description of the best-matching pattern

This is where the multimodal requirement comes in — QuantAgent requires a vision-capable LLM (GPT-4o, Claude 3.5+, Gemini 1.5 Pro). The Pattern Agent literally looks at the chart the way a technical analyst would.

3. Trend Agent

Generates annotated K-line charts overlaid with fitted trend channels — upper and lower boundary lines tracing recent highs and lows. From these:

  • Quantifies market direction (uptrend, downtrend, sideways)
  • Measures channel slope
  • Identifies consolidation zones and potential breakout levels

Output is a concise summary of prevailing trend structure.

4. Risk Agent

Pulls together risk-reward assessment: position sizing context, volatility regime, and the relationship between potential gain and stop-loss distance.

Decision Synthesis

A fifth layer — the Decision Agent — synthesizes all four outputs into a single actionable directive:

  • LONG or SHORT position
  • Recommended entry point
  • Exit point (take profit)
  • Stop-loss threshold
  • Rationale grounded in each agent’s findings

This is the output that matters: not a probability score or a sentiment label, but a concrete trade specification.

Architecture: LangChain + LangGraph

QuantAgent is built on LangChain and LangGraph — the same framework that powers most serious multi-agent LLM applications. LangGraph handles the agent orchestration: each agent runs as a node in a directed graph, and outputs flow through the graph to the synthesis layer.

The web interface runs on Flask with real-time market data from Yahoo Finance. You can analyze:

  • Any asset class — stocks, crypto, commodities, indices
  • Multiple timeframes — 1-minute to daily intervals
  • Custom date ranges
from trading_graph import TradingGraph

trading_graph = TradingGraph()

initial_state = {
    "kline_data": your_dataframe_dict,
    "analysis_results": None,
    "messages": [],
    "time_frame": "4hour",
    "stock_name": "BTC"
}

final_state = trading_graph.graph.invoke(initial_state)

Supported LLMs: OpenAI (GPT-4o), Anthropic (Claude), Qwen (DashScope). The vision requirement filters out text-only models.

Results

The paper tests QuantAgent across nine financial instruments including Bitcoin and Nasdaq futures, at both 1-hour and 4-hour trading intervals.

Key findings:

  • Consistently outperforms baseline methods on predictive accuracy across multiple evaluation metrics
  • Performance holds across asset classes — crypto and traditional futures both
  • The structured signal decomposition (four agents) outperforms single-agent approaches that try to do everything at once

The 1-hour and 4-hour timeframes are the sweet spot: long enough for meaningful pattern formation, short enough to trade on. This maps to the same lookback window insight from the Moskowitz momentum literature — where 12-month trends work for position trading, but shorter windows (1–4 hours) are the domain of intraday systems.

How to Run It

# Setup
conda create -n quantagents python=3.11
conda activate quantagents
pip install -r requirements.txt

# If TA-Lib gives you trouble:
conda install -c conda-forge ta-lib

# Set your LLM key
export OPENAI_API_KEY="your_key"
# or ANTHROPIC_API_KEY / DASHSCOPE_API_KEY

# Launch web interface
python web_interface.py
# → http://127.0.0.1:5000

The API key can also be set through the web interface directly — no need to touch environment variables if you prefer.

The Bigger Picture

QuantAgent is part of a wave of research applying multi-agent LLM architectures to problems that were previously the exclusive domain of traditional quant methods. What’s notable here is the decomposition strategy: rather than asking one model to simultaneously understand momentum, patterns, trends, and risk, they split those concerns across specialized agents and let each develop a focused view.

This mirrors how experienced traders actually think — a momentum trader, a chart reader, and a risk manager often occupy different roles in the same trade decision. QuantAgent formalizes that cognitive decomposition in code.

The “price-driven” framing is also significant. It’s a deliberate departure from the text-heavy approaches that dominate LLM finance research. Price is universal, real-time, and already encodes market consensus. For short-horizon decisions, it’s a cleaner signal than anything derived from text.


Related reading on this blog: