.PHONY: help install test run quick strict example1 example2 example3 clean

help:
	@echo "Autonomous Trading Strategy Backtester"
	@echo "========================================"
	@echo ""
	@echo "Quick Start:"
	@echo "  make install   - Install dependencies"
	@echo "  make run       - Run full backtest (5-10 min)"
	@echo "  make quick     - Quick backtest (2-3 min, shorter period)"
	@echo "  make strict    - Strict filtering (high-quality strategies only)"
	@echo ""
	@echo "Examples:"
	@echo "  make example1  - Basic backtest"
	@echo "  make example2  - Quick backtest"
	@echo "  make example3  - Custom strategy"
	@echo "  make examples  - All examples"
	@echo ""
	@echo "Development:"
	@echo "  make test      - Run tests"
	@echo "  make clean     - Remove outputs"
	@echo "  make lint      - Check code style"

install:
	@echo "Installing dependencies..."
	pip install -r requirements.txt
	@echo "✓ Installation complete"

test:
	@echo "Running tests..."
	pytest tests/ -v
	@echo "✓ Tests complete"

run:
	@echo "Running full backtest..."
	python backtester.py

quick:
	@echo "Running quick backtest (short period)..."
	python examples.py 2

strict:
	@echo "Running strict ranking..."
	python examples.py 3

example1:
	python examples.py 1

example2:
	python examples.py 2

example3:
	python examples.py 4

example4:
	python examples.py 5

examples:
	@echo "Running all examples..."
	python examples.py all

clean:
	@echo "Cleaning outputs..."
	rm -f ranking_report.csv ranking_report.html dashboard.html
	rm -rf outputs/
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete
	@echo "✓ Cleaned"

lint:
	@echo "Checking code style..."
	black --check backtester.py strategy_loader.py visualizations.py config.py examples.py
	flake8 backtester.py strategy_loader.py visualizations.py config.py examples.py --max-line-length=120
	@echo "✓ Lint complete"

format:
	@echo "Formatting code..."
	black backtester.py strategy_loader.py visualizations.py config.py examples.py
	@echo "✓ Formatted"

docs:
	@echo "README.md is your documentation"
	@echo "View with: cat README.md"

.DEFAULT_GOAL := help
