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>
Implements comprehensive strategy execution framework:
- ExecutionStatus, RetryPolicy, ExecutionEvent enums
- RetryConfig, MonitoringConfig, ExecutorConfig dataclasses
- OrderExecution, ExecutionResult tracking classes
- StrategyExecutor main class
Features:
- Synchronous and asynchronous signal execution
- Signal to order conversion via SignalToOrderConverter
- Order submission with configurable retry logic
- Order monitoring with timeout handling
- Event-driven architecture with handler registration
- Comprehensive execution metrics and logging
- Dry run mode for testing
- Support for stop loss and take profit orders
- Position manager integration (optional)
- Cancel execution capability
- Execution summary generation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements comprehensive signal to order conversion framework:
- TradingSignal dataclass for BUY/SELL/HOLD signals
- SignalToOrderConverter main class
- Multiple position sizing methods (fixed, percent, risk-based, volatility)
- Configurable stop loss (fixed percent, ATR-based, trailing)
- Configurable take profit (fixed percent, R:R ratio)
Features:
- Signal strength multipliers (strong/moderate/weak)
- Confidence scaling for position sizes
- Order validation with detailed error reporting
- Lot size rounding
- Max position size limits
- Automatic stop loss and take profit orders
- Support for limit orders with configurable offset
- Batch signal conversion
- Integration with OrderRequest from broker_base
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements comprehensive strategy comparison framework:
- StrategyMetrics dataclass for performance data
- PairwiseComparison for head-to-head analysis
- ComparisonResult with rankings and recommendations
- StrategyComparator main class
Features:
- Multi-criteria ranking (Sharpe, Sortino, returns, drawdown, etc.)
- Welch's t-test for statistical significance
- Summary statistics across all strategies
- Automated recommendations (volatility, drawdown, trade count warnings)
- Return distribution analysis with skew/kurtosis
- Ranking table generation with average rank calculation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements parallel scenario execution framework:
- ScenarioRunner with sequential, threaded, and process execution modes
- ScenarioConfig for configuring simulation parameters
- ScenarioResult for capturing simulation outcomes
- RunnerProgress for tracking execution progress
- Progress callbacks for real-time updates
- Cancellation support for long-running batches
- ScenarioBatchBuilder for parameter sweeps and variations
- Result aggregation with best/worst scenario identification
Features:
- Thread-safe parallel execution with configurable worker count
- FIFO result ordering preserved regardless of completion order
- Exception handling with graceful degradation
- Timeout support per scenario
- Cartesian product generation for parameter variations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements comprehensive portfolio state management:
- Holding dataclass with long/short support and P&L calculations
- CashBalance for multi-currency cash management
- PortfolioState class with:
- Real-time mark-to-market valuation
- Multi-currency support with exchange rate conversion
- Thread-safe state updates
- Position tracking with average cost calculation
- Portfolio snapshots for historical tracking
- PriceProvider and ExchangeRateProvider protocols
- Serialization/deserialization support
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created tradingagents/utils/output_validator.py with ValidationResult dataclass
- Added validate_report_completeness(), validate_decision_quality() for content validation
- Added validate_debate_state(), validate_agent_state() for state coherence
- Created tests/unit/test_output_validators.py with 54 unit tests
- Created tests/e2e/test_uat_agent_outputs.py with 23 UAT scenarios
- Added agent state fixtures to tests/conftest.py (sample_agent_state, debates)
- Total: 77 tests covering report quality, signal extraction, and state integrity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Moved 5 unit tests to tests/unit/ (exceptions, logging, report, docs, conftest)
- Moved 4 integration tests to tests/integration/ (openrouter, akshare, cli, deepseek)
- Created tests/e2e/ directory with README.md and conftest.py placeholder
- Added pytestmark = pytest.mark.unit/integration to all test files
- Updated pytest.ini with testpaths for new structure
- Updated docs/testing/README.md with new directory structure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>