diff --git a/datasource/tushare_source.py b/datasource/tushare_source.py index a0315ce..b189eec 100644 --- a/datasource/tushare_source.py +++ b/datasource/tushare_source.py @@ -325,12 +325,12 @@ class TushareSource: def _is_etf_code(self, code: str) -> bool: """判断是否为ETF代码""" - # ETF代码:51xxxx.SH, 52xxxx.SH, 15xxxx.SZ, 16xxxx.SZ + # ETF代码:51xxxx.SH, 52xxxx.SH, 56xxxx.SH, 58xxxx.SH(科创板), 15xxxx.SZ, 16xxxx.SZ import re if not re.match(r'^\d{6}\.(SZ|SH)$', code): return False prefix = code[:2] - return prefix in ['51', '52', '15', '16'] + return prefix in ['51', '52', '56', '58', '15', '16'] def _get_etf_type(self, code: str) -> str: """ diff --git a/rotation/simple_rotation.py b/rotation/simple_rotation.py index c02074a..de8fa2b 100644 --- a/rotation/simple_rotation.py +++ b/rotation/simple_rotation.py @@ -1854,13 +1854,15 @@ if __name__ == "__main__": os.environ['FLASK_API_URL'] = 'https://k3s.tokenpluse.xyz' parser = argparse.ArgumentParser(description='Simple Rotation Strategy Backtest') + parser.add_argument('--config', type=str, default=None, + help='Config file path (default: config_simple.yaml)') parser.add_argument('--no-detail', action='store_true', help='Skip detail JSON export (faster, for daily runs)') parser.add_argument('--no-report', action='store_true', help='Skip report PNG generation') args = parser.parse_args() - strategy = SimpleRotationStrategy() + strategy = SimpleRotationStrategy(config_path=args.config) result = strategy.run() if result: