Skip to content

Commit 529b52c

Browse files
authored
Bump strategy package pins and HK runtime profiles
1 parent 7994bb1 commit 529b52c

18 files changed

Lines changed: 57 additions & 90 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
assert CallableNotificationPort
9595
assert CallablePortfolioPort
9696
assert resolve_canonical_profile("mega_cap_leader_rotation_top50_balanced") == "mega_cap_leader_rotation_top50_balanced"
97-
assert resolve_hk_canonical_profile("hk_listed_global_etf_rotation") == "hk_listed_global_etf_rotation"
97+
assert resolve_hk_canonical_profile("hk_global_etf_tactical_rotation") == "hk_global_etf_tactical_rotation"
9898
PY
9999
100100
- name: Install editable shared repositories

.github/workflows/sync-cloud-run-env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ jobs:
200200
json.dumps(
201201
{
202202
"platform_id": "ibkr",
203-
"strategy_profile": "hk_listed_global_etf_rotation",
203+
"strategy_profile": "hk_global_etf_tactical_rotation",
204204
"deployment_selector": os.environ["ACCOUNT_GROUP_VALUE"],
205205
"account_scope": os.environ["ACCOUNT_GROUP_VALUE"],
206206
"execution_mode": "paper",

configs/paper_global_etf_rotation.rollback.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ACCOUNT_GROUP=default
44
IB_ACCOUNT_GROUP_CONFIG_SECRET_NAME=ibkr-account-groups
55
GLOBAL_TELEGRAM_CHAT_ID=<telegram-chat-id>
66
NOTIFY_LANG=zh
7-
# remove if previously set for tech_communication_pullback_enhancement:
7+
# remove if previously set by a snapshot-backed strategy:
88
# IBKR_FEATURE_SNAPSHOT_PATH
99
# IBKR_FEATURE_SNAPSHOT_MANIFEST_PATH
1010
# IBKR_STRATEGY_CONFIG_PATH

configs/paper_tech_communication_pullback_enhancement.dryrun.env.example

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/paper_tech_communication_pullback_enhancement.env.example

Lines changed: 0 additions & 11 deletions
This file was deleted.

configs/paper_tech_communication_pullback_enhancement.paper.env.example

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/hk_equity_runtime.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ QuantStrategyLab 现有平台仓库里,能接入港股股票交易的平台是
1414

1515
## 运行时设计
1616

17-
本仓库只做券商运行时能力,不把港股策略逻辑硬编码进平台。当前已接入 `HkEquityStrategies` 的港股 profile 元数据,平台可选港股 profile 只暴露 `runtime_enabled``hk_listed_global_etf_rotation``hk_blue_chip_leader_rotation` 是 snapshot 架构占位,`hk_index_mean_reversion``hk_etf_regime_rotation``market_history` 研究候选,均留在研究/快照仓库,不进入平台可选列表。Cloud Run 通过 `RUNTIME_TARGET_JSON` / `STRATEGY_PROFILE` 选择当前运行策略。整体沿用美股策略的架构:
17+
本仓库只做券商运行时能力,不把港股策略逻辑硬编码进平台。当前已接入 `HkEquityStrategies` 的港股 profile 元数据,平台可选港股 profile 只暴露 `runtime_enabled``hk_global_etf_tactical_rotation``hk_blue_chip_leader_rotation` 是 snapshot 架构占位,`hk_index_mean_reversion``hk_etf_regime_rotation``market_history` 研究候选,均留在研究/快照仓库,不进入平台可选列表。Cloud Run 通过 `RUNTIME_TARGET_JSON` / `STRATEGY_PROFILE` 选择当前运行策略。整体沿用美股策略的架构:
1818

1919
1. [`HkEquityStrategies`](https://github.com/QuantStrategyLab/HkEquityStrategies) 提供非 snapshot `hk_equity` 策略 profile、运行入口和 IBKR runtime adapter。
2020
2. [`HkEquitySnapshotPipelines`](https://github.com/QuantStrategyLab/HkEquitySnapshotPipelines) 发布 snapshot-backed profile 的 `<profile>_feature_snapshot_latest.csv`、manifest、ranking 和 release summary。
@@ -28,12 +28,12 @@ QuantStrategyLab 现有平台仓库里,能接入港股股票交易的平台是
2828

2929
| Profile | Domain | Inputs | Target mode | Snapshot manifest | Status |
3030
| --- | --- | --- | --- | --- | --- |
31-
| `hk_listed_global_etf_rotation` | `hk_equity` | `market_history` | `weight` | not required | runtime-enabled; platform-selectable |
31+
| `hk_global_etf_tactical_rotation` | `hk_equity` | `market_history` | `weight` | not required | runtime-enabled; platform-selectable |
3232
| `hk_blue_chip_leader_rotation` | `hk_equity` | `feature_snapshot` | `weight` | required | snapshot scaffold; not platform-selectable |
3333
| `hk_index_mean_reversion` | `hk_equity` | `market_history` | `weight` | not required | research/backtest only; not platform-selectable |
3434
| `hk_etf_regime_rotation` | `hk_equity` | `market_history` | `weight` | not required | research/backtest only; not platform-selectable |
3535

36-
`scripts/print_strategy_profile_status.py` 只显示平台可选 profile,因此只会列出 `hk_listed_global_etf_rotation` 这一条港股 profile。其他港股候选继续保留在研究文档和 snapshot pipeline,不应该出现在 Cloud Run switch plan 里。
36+
`scripts/print_strategy_profile_status.py` 只显示平台可选 profile,因此只会列出 `hk_global_etf_tactical_rotation` 这一条港股 profile。其他港股候选继续保留在研究文档和 snapshot pipeline,不应该出现在 Cloud Run switch plan 里。
3737

3838
未来启用 snapshot-backed profile 后的最小策略配置示例;这些 profile 晋级为 `runtime_enabled` 前不会出现在平台可选列表:
3939

@@ -76,7 +76,7 @@ IBKR_MARKET_DATA_SYMBOL_SUFFIX=.HK
7676

7777
```bash
7878
python scripts/print_strategy_switch_env_plan.py \
79-
--profile hk_listed_global_etf_rotation \
79+
--profile hk_global_etf_tactical_rotation \
8080
--dry-run-only \
8181
--deployment-selector hk-verify \
8282
--account-scope hk-verify \
@@ -87,7 +87,7 @@ python scripts/print_strategy_switch_env_plan.py \
8787

8888
这个命令只打印计划。输出会显式包含:
8989

90-
- `RUNTIME_TARGET_JSON``strategy_profile=hk_listed_global_etf_rotation``dry_run_only=true``execution_mode=paper`
90+
- `RUNTIME_TARGET_JSON``strategy_profile=hk_global_etf_tactical_rotation``dry_run_only=true``execution_mode=paper`
9191
- `IBKR_DRY_RUN_ONLY=true``IBKR_MARKET=HK` / `XHKG` / `SEHK` / `HKD` / `.HK`
9292
- `remove_if_present`:清理 snapshot/config 相关环境变量,因为该 profile 直接使用 `market_history`
9393
- `dry_run_plan`:检查 HK 行情权限、SEHK/HKD 映射、整数股和 lot-size、HKD 现金口径、通知和 runtime report。
@@ -99,7 +99,7 @@ python scripts/print_strategy_switch_env_plan.py \
9999
仓库的 `Deploy Cloud Run` workflow 支持手动 `workflow_dispatch` 目标 `hk-verify`。这个目标会设置或更新独立港股 dry-run 服务:
100100

101101
- `CLOUD_RUN_SERVICE=interactive-brokers-hk-verify-service`(可通过输入改名)
102-
- `STRATEGY_PROFILE=hk_listed_global_etf_rotation`
102+
- `STRATEGY_PROFILE=hk_global_etf_tactical_rotation`
103103
- `ACCOUNT_GROUP=hk-verify`
104104
- `RUNTIME_TARGET_JSON.execution_mode=paper``dry_run_only=true`
105105
- `IBKR_DRY_RUN_ONLY=true`
@@ -147,5 +147,5 @@ gh workflow run sync-cloud-run-env.yml \
147147
- IBKR 港股实盘依赖账户权限、行情权限、Gateway 登录账户可见账号和交易许可;平台配置无法替代这些权限。
148148
- 不同 IBKR 账户或区域对港股 symbol 格式可能有差异,首批上线前需要用 dry-run 和小范围 symbol 做实盘连接验证。
149149
- `XHKG` 是否可用取决于部署环境里的 `pandas_market_calendars` 版本;如不可用,可用 `IBKR_MARKET_CALENDAR` 临时覆盖。
150-
- `hk_listed_global_etf_rotation` 已在策略包 `runtime_enabled`,可由 IBKR HK Cloud Run 通过运行时环境选择;`hk_blue_chip_leader_rotation``hk_index_mean_reversion``hk_etf_regime_rotation` 仍不进入平台可选列表。
150+
- `hk_global_etf_tactical_rotation` 已在策略包 `runtime_enabled`,可由 IBKR HK Cloud Run 通过运行时环境选择;`hk_blue_chip_leader_rotation``hk_index_mean_reversion``hk_etf_regime_rotation` 仍不进入平台可选列表。
151151
- 港股 `market_history` profile 运行后,需要持续用 IBKR HK 行情 feed 对 `02800``03033``02822``02840``03110``03188``02834``03175` 做行情、价差、lot-size 和订单预览/执行结果复核。

notifications/telegram.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"strategy_name_qqq_tech_enhancement": "科技通信回调增强",
140140
"strategy_name_mega_cap_leader_rotation_top50_balanced": "Mega Cap Top50 平衡龙头轮动",
141141
"strategy_name_nasdaq_sp500_smart_dca": "纳斯达克 / 标普智能定投",
142-
"strategy_name_hk_listed_global_etf_rotation": "港股上市全球 ETF 轮动",
143-
"strategy_name_hk_high_dividend_low_vol_trend": "港股高股息低波趋势",
144-
"strategy_name_hk_low_vol_dividend_quality": "港股低波股息质量",
142+
"strategy_name_hk_global_etf_tactical_rotation": "港股全球 ETF 战术轮动",
143+
"strategy_name_hk_dividend_gold_defensive_rotation": "港股股息黄金防守轮动",
144+
"strategy_name_hk_low_vol_dividend_quality_snapshot": "港股低波股息质量快照",
145145
"strategy_name_tqqq_growth_income": "TQQQ 增长收益",
146146
"strategy_name_soxl_soxx_trend_income": "SOXL/SOXX 半导体趋势收益",
147147
},
@@ -280,9 +280,9 @@
280280
"strategy_name_qqq_tech_enhancement": "Tech/Communication Pullback Enhancement",
281281
"strategy_name_mega_cap_leader_rotation_top50_balanced": "Mega Cap Leader Rotation Top50 Balanced",
282282
"strategy_name_nasdaq_sp500_smart_dca": "Nasdaq/S&P 500 Smart DCA",
283-
"strategy_name_hk_listed_global_etf_rotation": "HK-listed Global ETF Rotation",
284-
"strategy_name_hk_high_dividend_low_vol_trend": "HK High Dividend Low-Volatility Trend",
285-
"strategy_name_hk_low_vol_dividend_quality": "HK Low-Volatility Dividend Quality",
283+
"strategy_name_hk_global_etf_tactical_rotation": "HK Global ETF Tactical Rotation",
284+
"strategy_name_hk_dividend_gold_defensive_rotation": "HK Dividend-Gold Defensive Rotation",
285+
"strategy_name_hk_low_vol_dividend_quality_snapshot": "HK Low-Vol Dividend Quality Snapshot",
286286
"strategy_name_tqqq_growth_income": "TQQQ Growth Income",
287287
"strategy_name_soxl_soxx_trend_income": "SOXL/SOXX Semiconductor Trend Income",
288288
},

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
flask
22
gunicorn
3-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@v0.7.36
4-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@v0.7.50
5-
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@hk-low-vol-dividend-quality-20260603
3+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@v0.7.37
4+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@v0.7.52
5+
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@v0.4.3
66
pandas
77
numpy
88
requests

scripts/build_cloud_run_env_sync_plan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _should_add_local_src(candidate: Path) -> bool:
3434
return _has_catalog_marker(
3535
candidate,
3636
"hk_equity_strategies",
37-
"hk_listed_global_etf_rotation",
37+
"hk_global_etf_tactical_rotation",
3838
)
3939
return True
4040

0 commit comments

Comments
 (0)