TradingAgents/tests
Andrew Kaszubski 6e52e4190d feat(backtest): add BacktestEngine with slippage and commission models - Issue #42 (57 tests)
Implements comprehensive backtesting framework:
- OrderSide, OrderType, FillStatus enums
- OHLCV bar data and Signal dataclasses
- BacktestConfig, BacktestPosition, BacktestTrade, BacktestResult
- BacktestSnapshot for portfolio tracking over time
- BacktestEngine main class

Slippage Models:
- NoSlippage: Zero slippage (ideal execution)
- FixedSlippage: Fixed amount per share
- PercentageSlippage: Percentage of price
- VolumeSlippage: Volume-impact model with participation ratio

Commission Models:
- NoCommission: Zero commission
- FixedCommission: Fixed per trade
- PerShareCommission: Per share with min/max
- PercentageCommission: Percentage of trade value
- TieredCommission: Tiered by trade value thresholds

Features:
- Historical price data replay with date filtering
- Multi-symbol portfolio support
- Automatic position sizing (equal weight)
- Buy/sell signal execution with slippage
- Cash and position tracking
- Shorting support (configurable)
- Max position percentage limits
- Minimum trade value enforcement
- Strategy callback for dynamic signals
- Portfolio snapshots at each timestamp
- Drawdown tracking with peak detection
- Sharpe and Sortino ratio calculation
- Win rate, profit factor, avg trade P&L
- Total commission and slippage tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 22:55:18 +11:00
..
api feat(db): add Portfolio model with LIVE/PAPER/BACKTEST types - Fixes #4 2025-12-26 13:46:39 +11:00
e2e feat(tests): add UAT and evaluation tests for agent outputs - Fixes #53 2025-12-26 11:38:37 +11:00
fixtures feat(tests): add test fixtures directory with mock data - Fixes #51 2025-12-26 11:23:29 +11:00
integration feat(dataflows): add benchmark data module with SPY, sector ETFs, RS, correlation, beta - Fixes #10 2025-12-26 16:14:57 +11:00
unit feat(backtest): add BacktestEngine with slippage and commission models - Issue #42 (57 tests) 2025-12-26 22:55:18 +11:00
CHROMADB_COLLECTION_TESTS.md fix(memory): use get_or_create_collection for idempotent ChromaDB init - Fixes #30 2025-12-26 09:20:04 +11:00
TRADE_MODEL_TEST_REFERENCE.md feat(portfolio): add Portfolio State for holdings and mark-to-market - Issue #29 (68 tests) 2025-12-26 21:37:17 +11:00
__init__.py feat(llm): add OpenRouter API support with proper headers and API key handling 2025-12-25 15:51:25 +11:00
conftest.py feat(db): add Settings model with risk profiles and alert preferences (#5) - Implements RiskProfile enum, risk parameters, JSON alert_preferences, one-to-one User relationship, CheckConstraints, cascade delete, 43 tests 2025-12-26 14:16:42 +11:00