SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.20138 · 2024

TradingAgents: Multi-Agents LLM Financial Trading Framework

arXiv · PDF · Open in the Atlas

Code that ran

5 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 9 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2412.20138.json · badge: /api/ran/2412.20138.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
tauricresearch/tradingagents canonical (classifier label)
classifier basis not recorded on the link
5 ran · 9 no recorded run
FunctionStatusWhere it lives
format_datetime_for_api Ran
ran on a synthesized input
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_common.py
code served (permissive licence) · get_code("097e5583df1ff05f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from datetime import datetime

# Test case 1: string date in YYYY-MM-DD format, start of day
date_str_start = "2024-01-15"

# Test case 2: string date in YYYY-MM-DD format, end of day
date_str_end = "2024-01-15"

# Test case 3: string date in YYYY-MM-DD HH:MM format
date_str_with_time = "2024-01-15 14:30"

# Test case 4: string already in Alpha Vantage format
date_str_formatted = "20240115T1430"

# Test case 5: datetime object
date_datetime = datetime(2024, 1, 15, 14, 30)

ARGS = {
    "date_input": "2024-01-15",
    "end_of_day": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
render_pm_decision Ran
ran on a synthesized input
tauricresearch/tradingagents/tradingagents/agents/schemas.py
code served (permissive licence) · get_code("ded6d5fec0f481fd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from enum import Enum
from pydantic import BaseModel, Field, field_validator

_NULLISH_FLOAT = {'', 'none', 'n/a', 'na', 'null', 'nil', '-', 'tbd', 'unknown'}

def _coerce_optional_float(value):
    if not isinstance(value, str):
        return value
    text = value.strip()
    if text.lower() in _NULLISH_FLOAT or text.endswith('%'):
        return None
    cleaned = text.replace(',', '').lstrip('$€£¥').strip()
    try:
        return float(cleaned)
    except ValueError:
        return None

class PortfolioRating(str, Enum):
    BUY = 'Buy'
    OVERWEIGHT = 'Overweight'
    HOLD = 'Hold'
    UNDERWEIGHT = 'Underweight'
    SELL = 'Sell'

class PortfolioDecision(BaseModel):
    rating: PortfolioRating = Field(description="The final position rating. Exactly one of Buy / Overweight / Hold / Underweight / Sell, picked based on the analysts' debate. Conflicting arguments alone are not a reason to Hold: commit to the stronger side, sized by how decisively it wins. Choose Hold only when the evidence is still balanced after weighing, or too thin to support a call.")
    executive_summary: str = Field(description='A concise action plan covering entry strategy, position sizing, key risk levels, and time horizon. Two to four sentences.')
    investment_thesis: str = Field(description="Detailed reasoning anchored in specific evidence from the analysts' debate. If prior lessons are referenced in the prompt context, incorporate them; otherwise rely solely on the current analysis.")
    price_target: float | None = Field(default=None, description="Optional target price in the instrument's quote currency.")
    time_horizon: str | None = Field(default=None, description="Optional recommended holding period, e.g. '3-6 months'.")

    @field_validator('price_target', mode='before')
    @classmethod
    def _nullish_float_to_none(cls, v):
        return _coerce_optional_float(v)

def render_pm_decision(decision: PortfolioDecision) -> str:
    parts = [f'**Rating**: {decision.rating.value}', '', f'**Executive Summary**: {decision.executive_summary}', '', f'**Investment Thesis**: {decision.investment_thesis}']
    target = decision.price_target if decision.price_target is not None else 'not provided'
    parts.extend(['', f'**Price Target**: {target}'])
    parts.extend(['', f"**Time Horizon**: {decision.time_horizon or 'not provided'}"])
    return '\n'.join(parts)

decision = PortfolioDecision(
    rating=PortfolioRating.BUY,
    executive_summary="Enter on dips below $150. Size position at 5% of portfolio. Watch support at $140; exit if breached. Hold for 6-12 months.",
    investment_thesis="Strong revenue growth combined with expanding margins supports upside. Competitive moat appears durable. Recent pullback offers entry at reasonable valuation multiples relative to historical averages and sector peers.",
    price_target=175.50,
    time_horizon="6-12 months"
)

ARGS = {
    'decision': decision
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
render_research_plan Ran
ran on a synthesized input
tauricresearch/tradingagents/tradingagents/agents/schemas.py
code served (permissive licence) · get_code("1a9049ace9c75f56")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from enum import Enum
from pydantic import BaseModel, Field

class PortfolioRating(str, Enum):
    """5-tier rating used by the Research Manager and Portfolio Manager."""
    BUY = 'Buy'
    OVERWEIGHT = 'Overweight'
    HOLD = 'Hold'
    UNDERWEIGHT = 'Underweight'
    SELL = 'Sell'

class ResearchPlan(BaseModel):
    """Structured investment plan produced by the Research Manager."""
    recommendation: PortfolioRating = Field(description='The investment recommendation.')
    rationale: str = Field(description='Conversational summary of the key points from both sides of the debate.')
    strategic_actions: str = Field(description="Concrete steps for the trader to implement the recommendation.")

def render_research_plan(plan: ResearchPlan) -> str:
    """Render a ResearchPlan to markdown for storage and the trader's prompt context."""
    return '\n'.join([f'**Recommendation**: {plan.recommendation.value}', '', f'**Rationale**: {plan.rationale}', '', f'**Strategic Actions**: {plan.strategic_actions}'])

# Construct a valid ResearchPlan instance
plan = ResearchPlan(
    recommendation=PortfolioRating.BUY,
    rationale='The bullish case focused on strong Q3 earnings growth and expanding margins, which outweighed concerns about rising interest rates. Market sentiment has shifted in favor of the sector.',
    strategic_actions='Increase allocation to 8% overweight from current 5%. Focus on large-cap positions with strong dividend yield and solid balance sheets. Consider gradual entry over 2 weeks to average in.'
)

ARGS = {
    'plan': plan
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
render_trader_proposal Ran
ran on a synthesized input
tauricresearch/tradingagents/tradingagents/agents/schemas.py
code served (permissive licence) · get_code("8f90f181d8bd7610")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from enum import Enum
from pydantic import BaseModel, Field, field_validator

torch.manual_seed(0)

_NULLISH_FLOAT = {'', 'none', 'n/a', 'na', 'null', 'nil', '-', 'tbd', 'unknown'}

def _coerce_optional_float(value):
    if not isinstance(value, str):
        return value
    text = value.strip()
    if text.lower() in _NULLISH_FLOAT or text.endswith('%'):
        return None
    cleaned = text.replace(',', '').lstrip('$€£¥').strip()
    try:
        return float(cleaned)
    except ValueError:
        return None

class TraderAction(str, Enum):
    BUY = 'Buy'
    HOLD = 'Hold'
    SELL = 'Sell'

class TraderProposal(BaseModel):
    action: TraderAction = Field(description='The transaction direction. Exactly one of Buy / Hold / Sell.')
    reasoning: str = Field(description="The case for this action, anchored in the analysts' reports and the research plan. Two to four sentences.")
    entry_price: float | None = Field(default=None, description="Optional entry price target as an absolute number in the instrument's quote currency (e.g. 189.5), never a percentage or a range. Omit it if you cannot state a specific level.")
    stop_loss: float | None = Field(default=None, description="Optional stop-loss as an absolute price in the instrument's quote currency (e.g. 172.0), never a percentage. Convert a percentage distance to the price level it implies, or omit it.")
    position_sizing: str | None = Field(default=None, description="Optional sizing guidance, e.g. '5% of portfolio'.")

    @field_validator('entry_price', 'stop_loss', mode='before')
    @classmethod
    def _nullish_float_to_none(cls, v):
        return _coerce_optional_float(v)

def render_trader_proposal(proposal: TraderProposal) -> str:
    parts = [f'**Action**: {proposal.action.value}', '', f'**Reasoning**: {proposal.reasoning}']
    for label, value in (('Entry Price', proposal.entry_price), ('Stop Loss', proposal.stop_loss), ('Position Sizing', proposal.position_sizing)):
        parts.extend(['', f"**{label}**: {(value if value is not None and value != '' else 'not provided')}"])
    parts.extend(['', f'FINAL TRANSACTION PROPOSAL: **{proposal.action.value.upper()}**'])
    return '\n'.join(parts)

proposal = TraderProposal(
    action=TraderAction.BUY,
    reasoning="The stock shows strong momentum with bullish technicals and positive analyst sentiment. Entry at current support level recommended with tight stop-loss below recent low.",
    entry_price=189.5,
    stop_loss=172.0,
    position_sizing="5% of portfolio"
)

ARGS = {
    'proposal': proposal
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
write_report_tree Ran
ran on a synthesized input
tauricresearch/tradingagents/tradingagents/reporting.py
code served (permissive licence) · get_code("e5313a2ed9f12424")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned PosixPath. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from pathlib import Path
import tempfile

ARGS = {
    'final_state': {
        'market_report': '## Market Analysis\n\nThe market is showing strong upward momentum with key indices rising.',
        'sentiment_report': '## Sentiment Analysis\n\nOverall sentiment is bullish based on recent news and social media.',
        'news_report': '## News Summary\n\nRecent earnings beat expectations by 15%.',
        'fundamentals_report': '## Fundamentals\n\nP/E ratio of 18.5, strong revenue growth of 25% YoY.',
        'investment_debate_state': {
            'bull_history': '## Bull Case\n\nStrong fundamentals support continued growth.',
            'bear_history': '## Bear Case\n\nValuation may be stretched at current levels.',
            'judge_decision': '## Manager Decision\n\nBull case is more compelling given current market conditions.',
        },
        'trader_investment_plan': '## Trading Plan\n\nRecommended entry point at 150.25, target exit at 165.50.',
        'risk_debate_state': {
            'aggressive_history': '## Aggressive View\n\nMaximize position size for higher returns.',
            'conservative_history': '## Conservative View\n\nKeep position size modest to limit downside risk.',
            'neutral_history': '## Neutral View\n\nModerate position sizing balances risk and reward.',
            'judge_decision': '## Portfolio Decision\n\nImplement conservative position sizing strategy.',
        },
    },
    'ticker': 'AAPL',
    'save_path': Path(tempfile.gettempdir()) / 'trading_report_test',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_balance_sheet Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_fundamentals.py
code served (permissive licence) · get_code("ce59bc2b85dab66c")
How it ran

no invocation recorded.

get_cashflow Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_fundamentals.py
code served (permissive licence) · get_code("bb6ff16cda6f0d37")
How it ran

no invocation recorded.

get_fundamentals Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_fundamentals.py
code served (permissive licence) · get_code("cb4bac9bb2880c82")
How it ran

no invocation recorded.

get_global_news Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_news.py
code served (permissive licence) · get_code("39b8d48d5296143f")
How it ran

no invocation recorded.

get_indicator Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_indicator.py
code served (permissive licence) · get_code("8b39135c26831d1c")
How it ran

no invocation recorded.

get_insider_transactions Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_news.py
code served (permissive licence) · get_code("92eeb78a6b4637dc")
How it ran

no invocation recorded.

get_model_options Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/llm_clients/model_catalog.py
code served (permissive licence) · get_code("25892712cbcf5b60")
How it ran

no invocation recorded.

get_news Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_news.py
code served (permissive licence) · get_code("8666fc73578ff028")
How it ran

no invocation recorded.

get_stock Not yet run
unverified (harvested, no recorded run)
tauricresearch/tradingagents/tradingagents/dataflows/alpha_vantage_stock.py
code served (permissive licence) · get_code("d494df06266c5009")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Significant progress has been made in automated problem-solving using societies of agents powered by large language models (LLMs). In finance, efforts have largely focused on single-agent systems handling specific tasks or multi-agent frameworks independently gathering data. However, the multi-agent systems' potential to replicate real-world trading firms' collaborative dynamics remains underexplored. TradingAgents proposes a novel stock trading framework inspired by trading firms, featuring LLM-powered agents in specialized roles such as fundamental analysts, sentiment analysts, technical analysts, and traders with varied risk profiles. The framework includes Bull and Bear researcher agents assessing market conditions, a risk management team monitoring exposure, and traders synthesizing insights from debates and historical data to make informed decisions. By simulating a dynamic, collaborative trading environment, this framework aims to improve trading performance. Detailed architecture and extensive experiments reveal its superiority over baseline models, with notable improvements in cumulative returns, Sharpe ratio, and maximum drawdown, highlighting the potential of multi-agent LLM frameworks in financial trading. TradingAgents is available at https://github.com/TauricResearch/TradingAgents.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2412.20138")
get_code_for_paper("2412.20138")
have("2412.20138")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2412.20138.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2412.20138.svg)](https://syntology.ai/paper/2412.20138)

Connect an agent — have() is free.