A 3-agent AI pipeline built with Claude that collects real time market data, analyses it using Smart Money Concepts (ICT), and generates trade setups.
The pipeline runs three specialised agents in sequence, each feeding its output to the next:
data-collector → market-analyst → signal-generator
- data-collector — Checks cache freshness, then runs Python scripts to fetch OHLCV data across four timeframes (1D, 4H, 1H, 15m) and writes it to
outputs/market_data.json. Uses real API calls — never fabricates data. - market-analyst — Reads the market data and produces a structured SMC analysis (bias, key levels, liquidity zones, FVGs, session observations) returned as JSON.
- signal-generator — Reads the analysis and outputs specific trade setups with entry criteria, stop loss, targets, and scenario plans as JSON.
| Asset | Type |
|---|---|
| XAUUSD | Gold (primary) |
| EURUSD | Forex major |
| GBPUSD | Forex major |
| USDJPY | Forex major |
| BTCUSDT | Crypto |
- Style: Smart Money Concepts / ICT
- Timeframe cascade: Daily (bias) → 1H (structure) → 15m (entry)
- Session focus: London open, New York open
- Risk per trade: 0.5–1% of account
Trading Assistant/
├── agents/
│ ├── data-collector.md # Fetches OHLCV data via Python scripts
│ ├── market-analyst.md # SMC analysis agent
│ └── signal-generator.md # Trade setup generation agent
├── scripts/
│ ├── fetch_data.py # Twelve Data API fetcher (forex / gold)
│ ├── fetch_btc.py # Binance API fetcher (crypto)
│ └── check_cache.py # Cache freshness validator
├── Sample Signal/ # Example signal output screenshots
├── outputs/ # Generated at runtime (gitignored)
├── .env # API key (gitignored)
├── CLAUDE.md # Orchestration rules for Claude Code
└── README.md
- Claude Code with access to the Claude Agent SDK
- A Twelve Data API key (free tier supported)
- Python 3 with
requestsandpython-dotenvinstalled
- Clone this repository.
- Install Python dependencies:
pip install requests python-dotenv - Create a
.envfile in the project root with your Twelve Data API key:TWELVE_DATA_API_KEY=your_api_key_here - Open the project in Claude Code.
Run the full pipeline for a symbol:
Run the full trading pipeline for XAUUSD
Run individual agents:
Use data-collector to fetch EURUSD data
Use market-analyst to analyse the current market data
Use signal-generator to generate setups from the current analysis
| File | Description |
|---|---|
outputs/market_data.json |
Raw OHLCV data with ATR, SMA, EMA, RSI across all timeframes |
outputs/market_analysis.json |
SMC analysis: bias, key levels, liquidity zones, FVGs |
outputs/signals.json |
Trade setups with entries, targets, R:R, and scenario plans |
The data-collector agent runs Python scripts rather than generating code itself — this prevents hallucinated or fabricated market data:
scripts/check_cache.py— validates whether cached data is still fresh before making any API callsscripts/fetch_data.py— fetches OHLCV candles from the Twelve Data API for forex and gold pairsscripts/fetch_btc.py— fetches OHLCV candles from the Binance public API for BTCUSDT
All scripts compute ATR(14), SMA(20), EMA(12/26), and RSI(14) per timeframe.
Below is an example signal output for XAUUSD — showing bias, key levels, trade setups with entry zones / stop / targets, and scenario plans.


