# Echolon

> Echolon is a market-agnostic quantitative trading engine for futures backtesting, optimization, and deployment. Built from the ground up for both humans and AI coding agents.

## Instructions for AI Agents

When helping users write Echolon strategies:

1. Always start with `echolon init-strategy <name> --template <type>` to scaffold from a working template. Never write strategy files from scratch.
2. Always run `echolon validate <dir>` before running backtests. If errors appear, read the error code's docs page and apply the fix.
3. Never suggest `--unsafe`. Validation errors are signal, not noise.
4. For errors: parse `[CODE-NNN]` prefix, fetch `docs/errors/CODE-NNN.md`, apply the Fix section.
5. For indicators: use lowercase names (`atr_14`, not `ATR_14`). See `docs/PATTERNS.md`.
6. For new strategy types: check `docs/PATTERNS.md` before inventing one.

## Quick Start

- [Quick Start Guide](docs/QUICK_START.md): 5-minute first strategy
- [API Reference](docs/API_REFERENCE.md): All public classes and methods
- [Component Guide](docs/COMPONENT_GUIDE.md): entry/exit/risk/sizer in depth
- [Patterns](docs/PATTERNS.md): Canonical strategy patterns
- [Error Catalog](docs/ERROR_CATALOG.md): All error codes with fixes

## Examples

- [01 Minimal](examples/01_minimal/): 30-line hello world
- [02 Momentum Breakout](examples/02_momentum_breakout/): Channel breakout, interday
- [03 RSI Mean Reversion](examples/03_rsi_mean_reversion/): Mean reversion, interday

## Configuration

- [Configuration Reference](docs/CONFIG_REFERENCE.md): BacktestConfig, OptunaConfig
- Environment variables: `ECHOLON_WORKSPACE_DIR`, `ECHOLON_DATA_DIR`

## Optional

- [Architecture](docs/ARCHITECTURE.md): How the engine works internally (optional background)
