Skip to main content

For AI agents

FinLab AI for AI Agents

Paste one prompt into Codex app or Claude cowork so AI can finish setup, research stock-picking strategies, run backtests, and query 900+ indicators across U.S. and Taiwan markets.

Free trial

Run your first U.S. stock backtest with AI in 30 seconds

Paste this to your AI. It installs FinLab, pulls the market data, and runs a backtest you can download.

Tell your AI:

Help me set up FinLab and try an AI quant research workflow. Please read: https://finlab.finance/en/setup

No install, open FinLab Studio

How do I give Claude Code access to U.S. stock data?

  1. Open Claude Code in a research folder with a terminal and Python available. Follow the AI-assisted setup guide to install the FinLab skill and Python package.
  2. Start a session in that folder and invoke /finlab. If the skill is missing, restart the session after installation and check the installed skills.
  3. Ask: “Use FinLab to inspect us_price:adj_close and us_income_statement:revenue for AAPL. Show the available dates and verify filing-date alignment before designing a daily stock strategy.”
  4. Complete FinLab's browser sign-in when requested. The SDK uses your own data access and download quota. Inspect the returned field names, dates and sample observations before requesting a backtest.

Claude Code loads reusable instructions from skills. See Anthropic's official skills guide for invocation and discovery.

How do I give Codex access to U.S. stock data?

  1. Open a local research folder in Codex with Python and terminal access. Paste the prompt from FinLab's setup guide and let the setup check the skill and SDK installation.
  2. Use /skills in Codex CLI to confirm FinLab is available, then mention $finlab in the research request. Restart Codex if a newly installed skill does not appear.
  3. Ask for the same AAPL data inspection above. For ETFs, request data.set_market("us_fund") and us_fund_price:adj_close for SPY and QQQ.
  4. Complete the SDK's browser sign-in if needed. Ask Codex to save the strategy code and standalone HTML report after a backtest, including the dates, universe, execution timing and cost assumptions.

See the official OpenAI skills documentation for skill discovery and invocation. The FinLab skill supplies research instructions; the Python SDK supplies the data interface and backtest engine.

Do I need a stock market MCP server to run a backtest?

A FinLab skill and local Python SDK can load data and run research without an MCP server. A read-only MCP catalog or published report lookup is a different capability from executing a new backtest. Check a server's documented tools before assuming it can download historical data or run a simulation. Neither installing a skill nor running a backtest grants brokerage permissions.

FinLab's research data is daily or slower, with separate stock and ETF/fund markets. It does not supply options or intraday data. Read the inspected U.S. coverage and timing limits, or compare Python research tools. Documentation checked November 2, 2026.

How do I backtest stocks with ChatGPT or Claude?

A chat window has no market data feed and no backtest engine, so numbers it writes without running anything cannot be checked. There are two ways to get real results. In FinLab Studio you describe the strategy in plain English and it runs the backtest, with nothing to install. If you already use Claude Code or Codex, add the FinLab Skill: your AI can then load U.S. and Taiwan market data, write the strategy and run it on the FinLab backtest engine.

Prompts that become reports

Each prompt keeps the setup URL attached, so the agent can find the installation instructions before it starts the research task.

Momentum strategy

Help me set up FinLab and test a U.S. momentum strategy against SPY: https://finlab.finance/en/setup

Backtest report, CAGR, Sharpe ratio, max drawdown, and strategy.py

Stock event report

Help me set up FinLab and analyze NVDA: https://finlab.finance/en/setup

Recent event timeline, historical reaction table, charts, and HTML report

Factor research

Help me set up FinLab and test a revenue growth plus momentum factor on U.S. stocks: https://finlab.finance/en/setup

Reusable factor script, benchmark comparison, and next A/B/C experiments

What happens after paste

  • The AI reads the setup URL and chooses the Codex or Claude cowork path.
  • It installs the official finlab-ai skill from GitHub when local tools are available.
  • It installs or checks the Python finlab package, then runs the requested research task.

Source code on GitHub

The finlab-ai skill is open source. AI agents can audit the install script, introspect the skill, or fork it — koreal6803/finlab-ai is the canonical source.

Install directly (Claude Code, Codex, Cursor)

npx skills add koreal6803/finlab-ai --skill finlab -g -y
View on GitHub

github.com/koreal6803/finlab-ai

What the skill exposes

  • Build quant strategies from natural-language prompts — no API memorisation required
  • Backtest across U.S. and Taiwan markets and report CAGR, Sharpe ratio, and max drawdown
  • Query 900+ fundamental, technical, and fund-flow indicators in a single call
  • Daily-updated data and reproducible backtests for AI agents to cite

See it on real backtests

Prefer the browser?

Open Studio for the no-CLI path — describe strategies and see backtests in the browser.

Open studio.finlab.finance