turtle_quant_1.backtesting.runner¶
turtle_quant_1.backtesting.runner
¶
Test runner for backtesting engine.
BacktestingTestCase
dataclass
¶
BacktestingTestCase(
name: str,
description: str,
strategy_engine: WeightedMeanStrategyEngine,
initial_capital: float,
symbols: List[str] = (lambda: BACKTESTING_SYMBOLS)(),
max_history_days: int = (lambda: MAX_HISTORY_DAYS)(),
max_lookback_days: int = (
lambda: BACKTESTING_MAX_LOOKBACK_DAYS
)(),
max_lookforward_days: int = (
lambda: BACKTESTING_MAX_LOOKFORWARD_DAYS
)(),
expected_results: Optional[Dict[str, Any]] = None,
)
Configuration for a backtesting test case.
BacktestingTestRunner
¶
BacktestingTestRunner(
test_cases: List[BacktestingTestCase],
)
Runner for executing and reporting backtesting test cases.
Source code in src/turtle_quant_1/backtesting/runner.py
get_failed_responses
¶
get_failed_responses() -> List[TestCaseResponse]
get_run_summary
¶
Get a summary of all test results.
Source code in src/turtle_quant_1/backtesting/runner.py
get_successful_responses
¶
get_successful_responses() -> List[TestCaseResponse]
run_tests
¶
run_tests() -> List[TestCaseResponse]
Run all test cases and return results.