openprophet.io | learn | github


Trading with AI: How LLM Agents Trade Stocks

AI trading agents use large language models — Claude, GPT, Gemini — to autonomously research markets, make trading decisions, and execute orders. Unlike traditional bots that follow hardcoded rules, these agents reason about market conditions in natural language, read news, and adapt strategies in real time.

How It Works

  1. Wake up — Agent activates on a schedule (heartbeat). In OpenProphet, intervals vary by market phase — every 2 minutes at open, every 10 minutes midday, every hour when closed.
  2. Gather information — Calls tools to check portfolio, read news, get quotes, scan options chains.
  3. Analyze and reason — LLM processes all data. Reads headlines, interprets RSI/MACD, checks past trades for similar setups, evaluates risk.
  4. Decide — Buy, sell, hold, or do nothing. Logs reasoning for every decision.
  5. Execute — Places orders through the brokerage API.
  6. Sleep — Dormant until next heartbeat.

How This Differs from Algorithmic Trading

Traditional algo bots (like Freqtrade) execute predefined rules: "if RSI < 30 and MACD crosses up, buy." The developer codes the rules. The bot cannot adapt to unanticipated situations.

LLM agents are different:

The Risk

AI trading agents carry unique risks:

This is why paper trading first. Alpaca provides free paper trading with real market data and simulated execution.

Models Used

Getting Started

  1. Create a free paper trading account at Alpaca
  2. Set up OpenProphet — clone from GitHub or use the Premium Setup Guide
  3. Configure your LLM provider
  4. Start with a conservative strategy on paper money
  5. Review decisions in the dashboard and daily logs

See Also


OpenProphet is experimental software. AI agents can hallucinate and result in total loss of an account. We never recommend connecting real money. This is not investment advice.
CC BY-NC 4.0 · Jake Nesler · Source on GitHub