# ICT ML Trading System

A production-grade machine learning trading system for DAX Futures based on ICT (Inner Circle Trader) concepts.

## Overview

This system detects ICT patterns (Fair Value Gaps, Order Blocks, Liquidity Sweeps) during the London session (3:00-4:00 AM EST) and uses machine learning to grade pattern quality and predict trade outcomes.

## Features

- **Pattern Detection**: Automated detection of FVG, Order Blocks, and Liquidity patterns
- **Machine Learning**: ML models for pattern grading and setup classification
- **Labeling System**: Integrated labeling workflow for training data
- **Backtesting**: Comprehensive backtesting framework
- **Alert System**: Real-time alerts via Telegram/Slack
- **Production Ready**: Comprehensive logging, error handling, and monitoring

## Project Structure

```
ict-ml-trading/
├── src/              # Source code
├── config/           # Configuration files
├── data/             # Data storage
├── models/           # Trained ML models
├── logs/             # Application logs
├── tests/            # Test suite
├── scripts/          # Utility scripts
└── docs/             # Documentation
```

## Quick Start

### Prerequisites

- Python 3.10+
- PostgreSQL (optional, for production)

### Installation

1. Clone the repository:
```bash
git clone <repository-url>
cd ict-ml-trading
```

2. Create virtual environment:
```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

3. Install dependencies:
```bash
make install-dev
```

4. Set up environment variables:
```bash
cp .env.example .env
# Edit .env with your configuration
```

5. Initialize database (optional):
```bash
make setup-db
```

## Development

### Running Tests

```bash
make test
```

### Code Formatting

```bash
make format
```

### Linting

```bash
make lint
```

### Type Checking

```bash
make type-check
```

## Configuration

Configuration files are located in `config/`:
- `config.yaml` - Main application configuration
- `logging.yaml` - Logging setup
- `detectors.yaml` - Pattern detector parameters
- `models.yaml` - ML model hyperparameters
- `trading.yaml` - Trading strategy parameters
- `alerts.yaml` - Alert system configuration
- `database.yaml` - Database connection settings

## Version History

See [CHANGELOG.md](CHANGELOG.md) for detailed version history.

## License

MIT License

## Contributing

See [docs/contributing.md](docs/contributing.md) for contribution guidelines.

