Agentic Trading Desk
Personal trading desk for technical analysis and short-term portfolio management on stocks and ETFs. The system combines the automation and query capabilities of an Artificial Intelligence agent (via Robinhood MCP protocol) with local deterministic mathematical calculation engines in Python.
The ruling principle is: the AI fetches data and interacts with the user; the scripts perform the deterministic calculations; the user decides and approves execution.
🚀 Project Architecture
The project is designed to operate locally and modularly. All technical indicator computations are delegated to Python 3 scripts that only use the Python standard library (stdlib), ensuring speed and zero network dependencies during execution.
graph TD
A[Robinhood MCP / API] -- Price Historicals / Quotes --> B[Claude / Agentic Core]
C[Investing.com / Web] -- 10Y-2Y Spread / News --> B
B -- JSON of Daily Closes --> D[scripts/macro_pillar.py]
B -- JSON of Closes + Holding status --> E[scripts/score.py]
D -- Injected Macro Score --> E
E -- Raw Indicators --> F[scripts/indicators.py]
E -- Three-Pillar Scorecard + Suggested Decision --> B
B -- Visualized Proposal --> G[User]
G -- Order Confirmation --> A
File Structure
- SKILL.md: Operations manual and specific guardrails guiding the AI agent's actions.
- scripts/indicators.py: Mathematical engine to calculate technical indicators without visual estimations.
- scripts/macro_pillar.py: Macro regime detector and cross-asset sentiment scorer.
- scripts/score.py: Evaluator of the three-pillar framework and exit/entry decision engine.
📈 The Three-Pillar Framework
Each analyzed asset is scored in three independent categories with scores from -2 to +2 (for a consolidated total range of -6 to +6):
1. Trend
Determined in scripts/score.py using:
- Price position relative to the EMA 20.
- Structural crossovers between exponential moving averages: EMA 20 > EMA 50 and EMA 50 > EMA 200.
- Slope direction of the EMA 200 (measured relative to 5 bars ago).
2. Momentum
Determined in scripts/score.py combining:
- RSI-14 using Wilder's smoothing (ne