Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ paper/compatibility later” as the default workflow.
- [`docs/us_equity_contract_gap_matrix.md`](./docs/us_equity_contract_gap_matrix.md): runtime-enabled profile contract gaps versus the cross-platform target.
- [`docs/us_equity_value_mode_input_contract.md`](./docs/us_equity_value_mode_input_contract.md): fixed canonical input contract for the two current value-mode profiles.
- [`docs/us_equity_strategy_status.zh-CN.md`](./docs/us_equity_strategy_status.zh-CN.md): Chinese operator-facing status handbook for switchable profiles, input modes, research candidates, and archived backtest evidence.
- [`docs/research/global_etf_confidence_vol_gate.md`](./docs/research/global_etf_confidence_vol_gate.md): Global ETF confidence plus relative-volatility gate research notes.
- [`docs/research/mega_cap_leader_rotation.md`](./docs/research/mega_cap_leader_rotation.md): mega-cap leader rotation research notes and Top50 balanced profile notes.

### Strategy index

| Canonical profile | Display name | Compatible platforms | Cadence | Benchmark | Role | Status |
| --- | --- | --- | --- | --- | --- | --- |
| `global_etf_rotation` | Global ETF Rotation | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | `quarterly + daily canary` | `VOO` | `defensive_rotation` | `runtime_enabled` |
| `global_etf_confidence_vol_gate` | Global ETF Confidence Vol Gate | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | `quarterly + daily canary` | `VOO` | `defensive_rotation_research_candidate` | `runtime_enabled` |
| `russell_1000_multi_factor_defensive` | Russell 1000 Multi-Factor | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | `monthly` | `SPY` | `defensive_stock_baseline` | `runtime_enabled` |
| `tech_communication_pullback_enhancement` | Tech/Communication Pullback Enhancement | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | `monthly` | `QQQ` | `parallel_cash_buffer_branch` | `runtime_enabled` |
| `mega_cap_leader_rotation_top50_balanced` | Mega Cap Leader Rotation Top50 Balanced | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | `monthly` | `QQQ` | `balanced_leader_rotation` | `runtime_enabled` |
Expand All @@ -78,6 +80,7 @@ Cloud Scheduler / GitHub Actions cron settings:
- `execution_timing_contract`
- `signal_effective_after_trading_days`
- the current daily runtime profiles (`global_etf_rotation`,
`global_etf_confidence_vol_gate`,
`tqqq_growth_income`, `soxl_soxx_trend_income`) are tagged as
`next_trading_day` strategies at the strategy/runtime contract layer, so
downstream runtimes and audit reports do not need to infer this from prose.
Expand All @@ -103,6 +106,7 @@ diagnostics when account equity is below the suggested minimum.
| `tqqq_growth_income` | `500 USD` | Most suitable for small accounts; TQQQ can usually trade, but BOXX/cash targets may drift. |
| `soxl_soxx_trend_income` | `1000 USD` | Can run with drift on integer-share platforms; fractional-share runtimes can express the small SOXX/BOXX legs more closely. |
| `global_etf_rotation` | `3000 USD` | Top-2 ETF rotation can drift when selected ETFs are too expensive for the account. |
| `global_etf_confidence_vol_gate` | `3000 USD` | Same execution caveats as `global_etf_rotation`; the profile can express unequal 75/25 targets only when share sizing supports them closely enough. |
| `mega_cap_leader_rotation_top50_balanced` | `10000 USD` | The fixed 50% Top2 / 50% Top4 sleeve blend can drift when integer shares cannot represent the intended unequal weights. |
| `tech_communication_pullback_enhancement` (`qqq_tech_enhancement` legacy alias) | `10000 USD` | Small accounts reduce position count and single-name concentration rises. |
| `russell_1000_multi_factor_defensive` | `30000 USD` | The default 24-stock basket is not suitable for small accounts. |
Expand All @@ -113,6 +117,7 @@ reports explicit about the gap between account size and backtest assumptions.
### Research candidates and archive

- `mega_cap_leader_rotation_top50_balanced`: runtime-enabled monthly profile for the current Top50 balanced candidate. It consumes a transparent Top50 monthly snapshot and runs a fixed 50% Top2 cap50 sleeve plus 50% Top4 cap25 sleeve, with no broad QQQ trend de-risking by default.
- `global_etf_confidence_vol_gate`: runtime-enabled experimental variant of `global_etf_rotation`. It keeps the same universe and canary defense, uses SMA250, and only shifts from 50/50 Top2 to 75/25 Top1/Top2 when the Top1 momentum z-gap is at least `1.0` and Top1's trailing 126-day volatility is no more than `1.3x` Top2's volatility.
- `mega_cap_leader_rotation`: umbrella research/backtest name for the static and dynamic variants; see [`docs/research/mega_cap_leader_rotation.md`](./docs/research/mega_cap_leader_rotation.md).

### global_etf_rotation
Expand Down Expand Up @@ -140,6 +145,11 @@ reports explicit about the gap between account size and backtest assumptions.
- If fewer than 2 names survive, the unused slot is parked in `BIL`.
- On non-rebalance days, the strategy returns no target change unless the canary emergency path is triggered.

**Confidence-volatility variant**
- `global_etf_rotation` keeps confidence weighting disabled by default.
- `global_etf_confidence_vol_gate` enables the same signal engine with `sma_period=250`, `confidence_threshold=1.0`, `confidence_top1_weight=0.75`, `confidence_volatility_window=126`, and `confidence_volatility_max_ratio=1.3`.
- The variant concentrates only when Top1 is clearly ahead and not materially more volatile than Top2; otherwise it remains equal-weight Top2.

**Why it exists**
- Compared with a pure tech or leveraged-Nasdaq approach, this profile is meant to be steadier.
- It still allows `VOO`, `XLK`, and `SMH` to win their way into the rotation instead of hard-coding them out.
Expand Down Expand Up @@ -332,13 +342,15 @@ The backtest output directory still includes `summary.csv`, `portfolio_returns.c
- [`docs/us_equity_contract_gap_matrix.md`](./docs/us_equity_contract_gap_matrix.md):runtime-enabled profile 距离跨平台目标契约的差异矩阵。
- [`docs/us_equity_value_mode_input_contract.md`](./docs/us_equity_value_mode_input_contract.md):两条 value-mode 策略的 canonical 输入契约定稿。
- [`docs/us_equity_strategy_status.zh-CN.md`](./docs/us_equity_strategy_status.zh-CN.md):中文运行手册,集中说明可切换 profile、输入类型、研究候选和已归档回测证据。
- [`docs/research/global_etf_confidence_vol_gate.md`](./docs/research/global_etf_confidence_vol_gate.md):Global ETF 置信度 + 相对波动过滤研究说明。
- [`docs/research/mega_cap_leader_rotation.md`](./docs/research/mega_cap_leader_rotation.md):巨头强者轮动的研究说明,以及 dynamic top20 运行 profile 说明。

### 策略索引

| Canonical profile | 显示名 | 兼容平台仓库 | 策略频率 | 核心思路 |
| --- | --- | --- | --- | --- |
| `global_etf_rotation` | 全球 ETF 轮动 | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | 季度调仓 + 每日 canary | 22 只全球 ETF 的季度 Top 2 轮动,带每日 canary 防守 |
| `global_etf_confidence_vol_gate` | 全球 ETF 置信度波动过滤 | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | 季度调仓 + 每日 canary | `global_etf_rotation` 的 SMA250 实验变体,高置信且 Top1 相对波动不过高时切 75/25 |
| `russell_1000_multi_factor_defensive` | 罗素1000多因子 | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | 月频 | Russell 1000 个股月频 price-only 选股,带 SPY + breadth 防守和 BOXX 停泊 |
| `tech_communication_pullback_enhancement` | 科技通信回调增强 | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | 月频 | tech-heavy 月频个股选择,做受控回调,并显式保留 BOXX 缓冲 |
| `mega_cap_leader_rotation_top50_balanced` | Mega Cap Top50 平衡龙头轮动 | `InteractiveBrokersPlatform`, `CharlesSchwabPlatform`, `LongBridgePlatform`, `PaperSignalPlatform` | 月频 | 当前 Top50 平衡候选,固定 50% Top2 cap50 + 50% Top4 cap25,不因 QQQ 趋势默认降仓 |
Expand All @@ -364,6 +376,7 @@ cron 配置由各个平台仓库负责:
| `tqqq_growth_income` | `500 USD` | 最适合小账户;通常能买到 TQQQ,但 BOXX / 现金层会有偏差。 |
| `soxl_soxx_trend_income` | `1000 USD` | 整数股平台会有偏离;支持碎股的运行时可以更接近小额 SOXX / BOXX 目标仓位。 |
| `global_etf_rotation` | `3000 USD` | Top2 ETF 轮动遇到高价 ETF 时会明显偏离。 |
| `global_etf_confidence_vol_gate` | `3000 USD` | 与 `global_etf_rotation` 相同;如果触发 75/25 不等权,小账户和整数股平台会更容易产生偏离。 |
| `mega_cap_leader_rotation_top50_balanced` | `10000 USD` | 固定 50% Top2 / 50% Top4 袖珍组合需要不等权持仓,小账户整数股会产生明显偏离。 |
| `tech_communication_pullback_enhancement`(历史别名 `qqq_tech_enhancement`) | `10000 USD` | 小账户会降低持仓数,单票集中度上升。 |
| `russell_1000_multi_factor_defensive` | `30000 USD` | 默认 24 只股票组合,不适合小账户。 |
Expand All @@ -373,6 +386,7 @@ cron 配置由各个平台仓库负责:
### 研究候选与存档

- `mega_cap_leader_rotation_top50_balanced`:已注册为 runtime-enabled 月频 profile,消费透明 Top50 月度 snapshot,运行固定 50% Top2 cap50 + 50% Top4 cap25 的组合,不默认使用宽基趋势降仓。
- `global_etf_confidence_vol_gate`:`global_etf_rotation` 的 runtime-enabled 实验变体。它保留同一标的池和 canary 防守,使用 SMA250;只有当 Top1 动量 z-gap 至少为 `1.0`,且 Top1 过去 126 日波动率不超过 Top2 的 `1.3x` 时,才从 Top2 等权切到 Top1/Top2 的 `75/25`。
- `mega_cap_leader_rotation`:静态池和动态池的研究/回测总称;说明见 [`docs/research/mega_cap_leader_rotation.md`](./docs/research/mega_cap_leader_rotation.md)。

### global_etf_rotation
Expand Down Expand Up @@ -400,6 +414,11 @@ cron 配置由各个平台仓库负责:
- 如果合格标的不满 2 个,空出来的部分停到 `BIL`。
- 非调仓日默认不改目标仓位,除非触发 canary 应急防守。

**置信度 + 波动过滤变体**
- `global_etf_rotation` 默认关闭置信度加权,保持原有 Top2 等权行为。
- `global_etf_confidence_vol_gate` 使用同一个信号引擎,但设置为 `sma_period=250`、`confidence_threshold=1.0`、`confidence_top1_weight=0.75`、`confidence_volatility_window=126`、`confidence_volatility_max_ratio=1.3`。
- 只有 Top1 明显领先且相对 Top2 不显著更高波动时,才切到 `75 / 25`;否则仍保持 Top2 等权。

**这套策略的定位**
- 相比纯科技或者杠杆纳指路线,这个档位更稳。
- 但它仍然允许 `VOO`、`XLK`、`SMH` 靠表现进入组合,而不是事先把它们排除。
Expand Down
36 changes: 36 additions & 0 deletions docs/research/global_etf_confidence_vol_gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Global ETF Confidence Vol Gate Research

_Updated: 2026-05-08_

## Candidate

`global_etf_confidence_vol_gate` is an experimental variant of `global_etf_rotation`.

- Universe, canary basket, safe haven, quarterly cadence, 13612W momentum, and hold bonus stay aligned with `global_etf_rotation`.
- The variant uses `sma_period=250`.
- It starts from the Top2 selection and normally stays equal-weight `50 / 50`.
- It shifts to `75 / 25` Top1/Top2 only when:
- Top1 momentum z-gap versus Top2 is at least `1.0`.
- Top1 trailing 126-trading-day annualized volatility is no more than `1.3x` Top2 volatility.

## Production-Like Backtest Snapshot

The research run used daily close history through 2026-05-07, quarterly rebalances, daily canary checks, and 5 bps turnover cost. The comparison below uses the same SMA250 baseline as the candidate.

| Strategy | Sample | CAGR | Max drawdown | Volatility | Sharpe | Final equity |
| --- | --- | ---: | ---: | ---: | ---: | ---: |
| Top2 SMA250 baseline | 2015-01-05 to 2026-05-06 | 13.60% | -23.35% | 19.21% | 0.762 | 4.242 |
| Ungated confidence 75/25 | 2015-01-05 to 2026-05-06 | 14.43% | -28.98% | 21.55% | 0.737 | 4.605 |
| Confidence + relative volatility gate | 2015-01-05 to 2026-05-06 | 14.77% | -23.35% | 19.59% | 0.803 | 4.763 |

## Interpretation

The ungated confidence rule improved CAGR but widened drawdown. The relative volatility gate filtered several high-confidence Top1 cases where the leader was much more volatile than the runner-up, bringing max drawdown back to the SMA250 Top2 baseline while preserving higher CAGR and Sharpe.

This does not make the profile a QQQ replacement: QQQ buy-and-hold still has a higher long-run CAGR in the same broad research window. The candidate is only an internal Global ETF enhancement path for operators who want the Global ETF risk profile but are willing to test a modest concentration rule.

## Rollout Recommendation

- Keep `global_etf_rotation` unchanged as the default defensive profile.
- Expose `global_etf_confidence_vol_gate` as a separate runtime profile.
- Use paper or small allocation first; integer-share runtimes may drift more because the candidate can target unequal `75 / 25` weights.
4 changes: 3 additions & 1 deletion docs/us_equity_contract_gap_matrix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# US equity contract gap matrix

_Updated: 2026-05-01_
_Updated: 2026-05-08_

This document tracks the current shared US equity strategy contract across
`UsEquityStrategies`, `QuantPlatformKit`, and the platform runtimes.
Expand All @@ -14,6 +14,7 @@ entries in this matrix.
The current runtime-enabled US equity profiles are:

- `global_etf_rotation`
- `global_etf_confidence_vol_gate`
- `tqqq_growth_income`
- `soxl_soxx_trend_income`
- `russell_1000_multi_factor_defensive`
Expand Down Expand Up @@ -64,6 +65,7 @@ New US equity profiles should use only these canonical `required_inputs`:
| Profile | `target_mode` | `required_inputs` | Adapter coverage | Runtime status | Notes |
| --- | --- | --- | --- | --- | --- |
| `global_etf_rotation` | `weight` | `market_history` | `ibkr`, `schwab`, `longbridge`, `paper_signal` | runtime-enabled | Quarterly top-2 ETF rotation with daily canary defense. |
| `global_etf_confidence_vol_gate` | `weight` | `market_history` | `ibkr`, `schwab`, `longbridge`, `paper_signal` | runtime-enabled | SMA250 Global ETF variant that allows 75/25 Top1/Top2 only behind a momentum-confidence and relative-volatility gate. |
| `tqqq_growth_income` | `value` | `benchmark_history`, `portfolio_snapshot` | `ibkr`, `schwab`, `longbridge`, `paper_signal` | runtime-enabled | Direct QQQ/TQQQ growth-income profile with explicit portfolio input. |
| `soxl_soxx_trend_income` | `value` | `derived_indicators`, `portfolio_snapshot` | `ibkr`, `schwab`, `longbridge`, `paper_signal` | runtime-enabled | Semiconductor trend profile using canonical derived indicators. |
| `russell_1000_multi_factor_defensive` | `weight` | `feature_snapshot` | `ibkr`, `schwab`, `longbridge`, `paper_signal` | runtime-enabled | Artifact-backed Russell 1000 defensive selection. |
Expand Down
6 changes: 4 additions & 2 deletions docs/us_equity_strategy_status.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 美股策略状态与研究手册

_更新日期:2026-05-04_
_更新日期:2026-05-08_

这份文档只记录当前可配置的美股策略 profile、输入形态和研究状态,不记录任何账户或服务正在运行的 profile。部署单元当前跑什么属于私有运行信息,应留在云端配置或私有运行记录里。

Expand All @@ -10,11 +10,12 @@ _更新日期:2026-05-04_

## 当前可配置 profiles

6 条 profile 是当前 `runtime_enabled` `us_equity` 集合。它们按共享文档规范设计为通用策略,平台侧通过同一份 catalog、manifest、entrypoint 和 runtime adapter 契约接入;是否实盘启用仍由各部署配置和风控决定。
7 条 profile 是当前 `runtime_enabled` `us_equity` 集合。它们按共享文档规范设计为通用策略,平台侧通过同一份 catalog、manifest、entrypoint 和 runtime adapter 契约接入;是否实盘启用仍由各部署配置和风控决定。

| Profile | 中文定位 | 输入类型 | 特点 | 当前建议 |
| --- | --- | --- | --- | --- |
| `global_etf_rotation` | 全球 ETF 防守轮动 | 直接运行输入 | 季度 Top2 ETF 轮动,每日 canary 防守,弱市切 `BIL`。 | 可切换;偏低波动防守线。 |
| `global_etf_confidence_vol_gate` | 全球 ETF 置信度波动过滤 | 直接运行输入 | `global_etf_rotation` 的 SMA250 实验变体;高置信且 Top1 相对波动不过高时切 `75% / 25%`。 | 可做 paper / 小比例观察;不是替代默认档。 |
| `tqqq_growth_income` | TQQQ 增长收益 | 直接运行输入 | `QQQ` / `TQQQ` 双轮增长,默认 `45% / 45% / 8% BOXX / 2% cash`;`QQQM` 可作为低单价交易代理。 | 小账户最容易落地;不需要 snapshot artifact。 |
| `soxl_soxx_trend_income` | SOXL/SOXX 半导体趋势收益 | 直接运行输入 | 以 `SOXX` 140 日趋势闸门控制 `SOXL` / `SOXX` / `BOXX`;剩余资金停 BOXX,可叠加收入层。 | 半导体高弹性直接输入策略;波动高于宽基。 |
| `tech_communication_pullback_enhancement` | 科技通信回调增强 | feature snapshot | 科技/通信个股月频选择,受控回调入场,保留 BOXX 缓冲。 | 需要月度 snapshot;适合先小比例或观察运行。 |
Expand Down Expand Up @@ -45,6 +46,7 @@ _更新日期:2026-05-04_
| TQQQ 买入持有参考 | 2017-01-03 至 2026-04-10 | 37.77% | -81.66% | 收益高但回撤过深,只作风险参照。 | 同上 |
| Top50 `blend_top2_50_top4_50`,21 日 universe lag | 2017-10-02 至 2026-04-16 | 36.41% | -30.56% | 当前最强无杠杆候选之一;回撤可接受但 Top2 袖子带来集中风险,需要 paper 观察。 | `UsEquitySnapshotPipelines/data/output/mega_cap_leader_rotation_dynamic_top50_concentration_variants/concentration_variant_summary.csv` |
| Top50 `top2_cap50_no_defense`,21 日 universe lag | 2017-10-02 至 2026-04-16 | 39.83% | -38.79% | 收益最高但两只股票 50/50 太集中,只作为 aggressive research 证据,不作为默认。 | `UsEquitySnapshotPipelines/docs/mega-cap-leader-rotation-dynamic-validation.md` |
| `global_etf_confidence_vol_gate` production-like 研究 | 2015-01-05 至 2026-05-06 | 14.77% | -23.35% | 相比同口径 Top2/SMA250 的 13.60% CAGR、-23.35% 回撤,收益和 Sharpe 改善;仍未跑赢 QQQ 长期 CAGR,因此只作为 Global ETF 自身增强候选。 | [`docs/research/global_etf_confidence_vol_gate.md`](./research/global_etf_confidence_vol_gate.md) |
| Crisis unified response historical research,含旧 5% TACO 袖子 | 1999-03-10 至 2026-04-16 | 23.89% | -56.04% | 相比合成 TQQQ 基线显著降低 2000/2008 级别灾难回撤;但该历史版本包含 TACO,不等于当前 defense-only shadow plugin。 | `UsEquitySnapshotPipelines/data/output/crisis_response_audit_trial/external_fragility10_severe10_fin_credit/summary.csv` |

暂时没有写进正式表的内容:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "us-equity-strategies"
version = "0.7.33"
version = "0.7.34"
description = "Shared US equity strategy catalog and implementations"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
1 change: 1 addition & 0 deletions src/us_equity_strategies/account_sizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

MIN_RECOMMENDED_EQUITY_USD: dict[str, float] = {
"global_etf_rotation": 3_000.0,
"global_etf_confidence_vol_gate": 3_000.0,
"tqqq_growth_income": 500.0,
"soxl_soxx_trend_income": 1_000.0,
"russell_1000_multi_factor_defensive": 30_000.0,
Expand Down
Loading