085e51abf1
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
27 lines
803 B
Python
27 lines
803 B
Python
#!/usr/bin/env python3
|
|
"""End-to-end smoke test: download data -> backtest 5-day reversal -> print results."""
|
|
import logging
|
|
from backtest.config import BacktestConfig
|
|
from backtest.runner import BacktestRunner
|
|
from strategies.reversal import FiveDayReversal
|
|
from analysis.report import print_results
|
|
|
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
|
|
|
|
|
def main():
|
|
config = BacktestConfig(
|
|
symbols=["sh600000", "sz000001", "sh600519"], # 浦发银行, 平安银行, 贵州茅台
|
|
start_date="2023-01-01",
|
|
end_date="2024-12-31",
|
|
initial_cash=1_000_000,
|
|
)
|
|
|
|
runner = BacktestRunner(config)
|
|
results = runner.run(FiveDayReversal)
|
|
print_results(results, config.initial_cash)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|