feat(backtest): add CLI command with auto data fetch and table output

- Created src/easy_tdx/backtest/cli.py with backtest command
- Supports --strategy-file to load Python strategy classes
- Supports --indicators to precompute technical indicators
- Supports --cash, --commission, --execution, --period, --adjust, --count options
- Supports json/table/csv output formats
- Auto-loads K-line data via get_mac_client()
- Registered backtest command in src/easy_tdx/cli/__init__.py
- Added tests/unit/test_backtest_cli.py with basic CLI tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
GitHub
2026-06-09 18:15:37 +08:00
co-authored by Claude Opus 4.8
parent 706f22ba5e
commit fc0777533e
3 changed files with 245 additions and 0 deletions
+2
View File
@@ -19,6 +19,7 @@ from .cmd_offline import offline
from .cmd_quote import quote, quote_list
from .cmd_tick import tick
from .cmd_transaction import transaction
from ..backtest.cli import backtest
@click.group()
@@ -66,3 +67,4 @@ cli.add_command(indicator)
cli.add_command(indicator_list)
cli.add_command(offline)
cli.add_command(chanlun)
cli.add_command(backtest)