Skip to content

Jobleshot/trading-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading Assistant

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.

Overview

The pipeline runs three specialised agents in sequence, each feeding its output to the next:

data-collector → market-analyst → signal-generator
  1. 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.
  2. market-analyst — Reads the market data and produces a structured SMC analysis (bias, key levels, liquidity zones, FVGs, session observations) returned as JSON.
  3. signal-generator — Reads the analysis and outputs specific trade setups with entry criteria, stop loss, targets, and scenario plans as JSON.

Markets Covered

Asset Type
XAUUSD Gold (primary)
EURUSD Forex major
GBPUSD Forex major
USDJPY Forex major
BTCUSDT Crypto

Trading Methodology

  • 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

Project Structure

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

Requirements

  • Claude Code with access to the Claude Agent SDK
  • A Twelve Data API key (free tier supported)
  • Python 3 with requests and python-dotenv installed

Setup

  1. Clone this repository.
  2. Install Python dependencies:
    pip install requests python-dotenv
    
  3. Create a .env file in the project root with your Twelve Data API key:
    TWELVE_DATA_API_KEY=your_api_key_here
    
  4. Open the project in Claude Code.

Usage

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

Output Files

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

How Data Collection Works

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 calls
  • scripts/fetch_data.py — fetches OHLCV candles from the Twelve Data API for forex and gold pairs
  • scripts/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.

Sample Output

Below is an example signal output for XAUUSD — showing bias, key levels, trade setups with entry zones / stop / targets, and scenario plans.

XAUUSD signal output 1 XAUUSD signal output 2 XAUUSD signal output 3

About

Market Analysis tool - Claude Code Project (learning agent workflows)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages