Oft3r/agentic-trading-desk

AI-assisted trading desk for short-term technical analysis on stocks & ETFs via Robinhood MCP. Deterministic Python engines score each asset on a three-pillar framework (Trend · Momentum · Macro-Sentiment) using EMA, RSI, MACD, TRIX & Bollinger Bands. The AI fetches data; the scripts compute; the human approves every order.

What it solves

This project provides a personal trading desk for stocks and ETFs that removes AI hallucinations from financial calculations. It solves the problem of relying on LLMs for mathematical analysis by delegating all technical indicator and scoring logic to deterministic Python scripts, while using the AI agent as an orchestrator for data fetching, user interaction, and trade execution.

How it works

The system uses a hybrid architecture where an AI agent (integrated with Claude Code and the Robinhood MCP protocol) handles the non-deterministic tasks, while a suite of Python scripts performs the actual analysis:

  • Data Orchestration: The agent fetches price historicals and quotes via Robinhood and macro data from Investing.com.
  • Deterministic Calculation: The agent passes this data as JSON to specialized scripts:
    • macro_pillar.py: Analyzes cross-asset sentiment (e.g., yield curves, sector rotation) to create a macro score.
    • indicators.py: Calculates raw technical indicators (EMA, RSI, MACD, TRIX).
    • score.py: Combines indicators and macro scores into a "Three-Pillar Framework" (Trend, Momentum, Macro-Sentiment) to generate a specific trading decision (e.g., EXIT, RE-ENTRY, HOLD).
  • Execution Guardrails: To prevent AI errors, the system employs a PreToolUse hook (mandate-order-guard.sh) that intercepts tool calls to the broker. It enforces hard limits on order types, session timing (market vs. limit orders), and maximum notional value ($1,200).
  • Qualitative Reinforcement: The agent supplements the mathematical score with news and analyst consensus from Google Finance and Investing.com, though this does not alter the deterministic score.

Who it’s for

It is designed for individual traders who want an agentic workflow for short-term portfolio management but require strict mathematical certainty and risk guardrails to prevent an AI from making unauthorized or erroneous trades.

Highlights

  • Three-Pillar Scoring: A quantitative framework scoring Trend, Momentum, and Macro-Sentiment from -2 to +2.
  • Deterministic Engine: Zero reliance on LLMs for math; all indicators are calculated using Python's standard library.
  • Harness-Level Guards: Uses shell hooks to block prohibited order types (like stop orders) before they reach the broker.
  • MCP Integration: Leverages the Model Context Protocol for seamless interaction with Robinhood brokerage accounts.

Related

  • Project
  • Project
  • Project
  • Project