Skip to content

Commit dfafc8c

Browse files
committed
Group recommendations by horizon
1 parent 4c3837d commit dfafc8c

17 files changed

Lines changed: 410 additions & 63 deletions

.github/workflows/monthly_advisory_review.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ on:
3737
required: false
3838
default: ""
3939
type: string
40+
market_data_proxy_urls:
41+
description: "Optional comma/newline-separated public proxy URLs for free market data fetches."
42+
required: false
43+
default: ""
44+
type: string
45+
market_data_proxy_pool_url:
46+
description: "Optional public text URL returning one proxy per line for free market data fetches."
47+
required: false
48+
default: ""
49+
type: string
4050
schedule:
4151
- cron: "20 13 1 * *"
4252

@@ -74,6 +84,8 @@ jobs:
7484
AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }}
7585
THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }}
7686
MARKET_CONFIRMATION_PATH: ${{ github.event.inputs.market_confirmation_path || '' }}
87+
MARKET_DATA_PROXY_URLS: ${{ github.event.inputs.market_data_proxy_urls || vars.MARKET_DATA_PROXY_URLS || '' }}
88+
MARKET_DATA_PROXY_POOL_URL: ${{ github.event.inputs.market_data_proxy_pool_url || vars.MARKET_DATA_PROXY_POOL_URL || '' }}
7789
run: |
7890
set -euo pipefail
7991
AS_OF="${INPUT_AS_OF:-$(date -u +%F)}"
@@ -98,6 +110,12 @@ jobs:
98110
if [ -n "${RESOLVED_THEME_MOMENTUM}" ]; then
99111
MARKET_BUILD_ARGS+=(--theme-momentum "${RESOLVED_THEME_MOMENTUM}")
100112
fi
113+
if [ -n "${MARKET_DATA_PROXY_URLS}" ]; then
114+
MARKET_BUILD_ARGS+=(--proxy-urls "${MARKET_DATA_PROXY_URLS}")
115+
fi
116+
if [ -n "${MARKET_DATA_PROXY_POOL_URL}" ]; then
117+
MARKET_BUILD_ARGS+=(--proxy-pool-url "${MARKET_DATA_PROXY_POOL_URL}")
118+
fi
101119
python scripts/build_market_confirmation.py "${MARKET_BUILD_ARGS[@]}"
102120
MARKET_ARGS=(--market-confirmation "${GENERATED_MARKET_CONFIRMATION}")
103121
fi

.github/workflows/publish_advisory_site.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ on:
3737
required: false
3838
default: ""
3939
type: string
40+
market_data_proxy_urls:
41+
description: "Optional comma/newline-separated public proxy URLs for free market data fetches."
42+
required: false
43+
default: ""
44+
type: string
45+
market_data_proxy_pool_url:
46+
description: "Optional public text URL returning one proxy per line for free market data fetches."
47+
required: false
48+
default: ""
49+
type: string
4050
schedule:
4151
- cron: "0 13 * * 6"
4252

@@ -83,6 +93,8 @@ jobs:
8393
AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }}
8494
THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }}
8595
MARKET_CONFIRMATION_PATH: ${{ github.event.inputs.market_confirmation_path || '' }}
96+
MARKET_DATA_PROXY_URLS: ${{ github.event.inputs.market_data_proxy_urls || vars.MARKET_DATA_PROXY_URLS || '' }}
97+
MARKET_DATA_PROXY_POOL_URL: ${{ github.event.inputs.market_data_proxy_pool_url || vars.MARKET_DATA_PROXY_POOL_URL || '' }}
8698
run: |
8799
set -euo pipefail
88100
AS_OF="${INPUT_AS_OF:-$(date -u +%F)}"
@@ -107,6 +119,12 @@ jobs:
107119
if [ -n "${RESOLVED_THEME_MOMENTUM}" ]; then
108120
MARKET_BUILD_ARGS+=(--theme-momentum "${RESOLVED_THEME_MOMENTUM}")
109121
fi
122+
if [ -n "${MARKET_DATA_PROXY_URLS}" ]; then
123+
MARKET_BUILD_ARGS+=(--proxy-urls "${MARKET_DATA_PROXY_URLS}")
124+
fi
125+
if [ -n "${MARKET_DATA_PROXY_POOL_URL}" ]; then
126+
MARKET_BUILD_ARGS+=(--proxy-pool-url "${MARKET_DATA_PROXY_POOL_URL}")
127+
fi
110128
python scripts/build_market_confirmation.py "${MARKET_BUILD_ARGS[@]}"
111129
MARKET_ARGS=(--market-confirmation "${GENERATED_MARKET_CONFIRMATION}")
112130
fi

.github/workflows/weekly_advisory_review.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ on:
3232
required: false
3333
default: ""
3434
type: string
35+
market_data_proxy_urls:
36+
description: "Optional comma/newline-separated public proxy URLs for free market data fetches."
37+
required: false
38+
default: ""
39+
type: string
40+
market_data_proxy_pool_url:
41+
description: "Optional public text URL returning one proxy per line for free market data fetches."
42+
required: false
43+
default: ""
44+
type: string
3545
schedule:
3646
- cron: "30 12 * * 6"
3747

@@ -68,6 +78,8 @@ jobs:
6878
AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }}
6979
THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }}
7080
MARKET_CONFIRMATION_PATH: ${{ github.event.inputs.market_confirmation_path || '' }}
81+
MARKET_DATA_PROXY_URLS: ${{ github.event.inputs.market_data_proxy_urls || vars.MARKET_DATA_PROXY_URLS || '' }}
82+
MARKET_DATA_PROXY_POOL_URL: ${{ github.event.inputs.market_data_proxy_pool_url || vars.MARKET_DATA_PROXY_POOL_URL || '' }}
7183
run: |
7284
set -euo pipefail
7385
AS_OF="${INPUT_AS_OF:-$(date -u +%F)}"
@@ -92,6 +104,12 @@ jobs:
92104
if [ -n "${RESOLVED_THEME_MOMENTUM}" ]; then
93105
MARKET_BUILD_ARGS+=(--theme-momentum "${RESOLVED_THEME_MOMENTUM}")
94106
fi
107+
if [ -n "${MARKET_DATA_PROXY_URLS}" ]; then
108+
MARKET_BUILD_ARGS+=(--proxy-urls "${MARKET_DATA_PROXY_URLS}")
109+
fi
110+
if [ -n "${MARKET_DATA_PROXY_POOL_URL}" ]; then
111+
MARKET_BUILD_ARGS+=(--proxy-pool-url "${MARKET_DATA_PROXY_POOL_URL}")
112+
fi
95113
python scripts/build_market_confirmation.py "${MARKET_BUILD_ARGS[@]}"
96114
MARKET_ARGS=(--market-confirmation "${GENERATED_MARKET_CONFIRMATION}")
97115
fi

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,23 @@ relative returns versus SPY, volume z-score, 63-day drawdown, 21-day annualized
191191
volatility, and `market_score`. The weekly/monthly/publish workflows generate
192192
this file automatically before building advisory reports.
193193

194+
Optional proxy inputs:
195+
196+
- `--proxy-urls`: comma/newline-separated proxy URLs.
197+
- `--proxy-list`: local text file with one proxy per line.
198+
- `--proxy-pool-url`: public text URL returning one proxy per line.
199+
200+
The scheduled workflows also read repository variables `MARKET_DATA_PROXY_URLS`
201+
and `MARKET_DATA_PROXY_POOL_URL`. The script tries direct Yahoo access first and
202+
then retries through proxies. Logs record proxy indexes only, not full proxy
203+
URLs.
204+
194205
Yahoo chart is currently the no-dependency free price endpoint. If it is
195206
unavailable, the script falls back to price-momentum fields already saved in
196207
`theme_momentum_snapshot.json`, so report generation continues. Random free
197-
proxy pools should not be treated as a stable production data source; prefer
198-
organization-owned price snapshots, caches, or auditable controlled proxies.
208+
proxy pools can be used as an emergency supplement, but should not be treated as
209+
a stable production data source; prefer organization-owned price snapshots,
210+
caches, or auditable controlled proxies.
199211

200212
## Output Contract
201213

README.zh-CN.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,12 @@ python scripts/build_market_confirmation.py \
215215

216216
字段包括 `return_5d``return_20d``return_63d`、相对 SPY 收益、成交量 z-score、63 日回撤、21 日年化波动和 `market_score`。线上 weekly/monthly/publish workflow 会自动生成该文件,再传给报告生成器。
217217

218-
Yahoo chart 下载只是当前无依赖的免费行情入口;如果不可用,脚本会退回到 `theme_momentum_snapshot.json` 里的价格动量信息,报告仍能生成。不要把随机免费代理 IP 池作为稳定生产方案;它有稳定性、数据污染、封禁、隐私和合规风险。更稳的做法是使用本组织已有价格快照、缓存文件,或可审计的自有代理/数据源。
218+
可选代理参数:
219+
220+
- `--proxy-urls`:逗号或换行分隔的代理列表。
221+
- `--proxy-list`:本地代理列表文件。
222+
- `--proxy-pool-url`:公共代理池文本 URL,一行一个代理。
223+
224+
线上 workflow 也支持仓库变量 `MARKET_DATA_PROXY_URLS``MARKET_DATA_PROXY_POOL_URL`。脚本会先直连 Yahoo,失败后再尝试代理;日志只记录代理序号,不输出代理完整地址。
225+
226+
Yahoo chart 下载只是当前无依赖的免费行情入口;如果不可用,脚本会退回到 `theme_momentum_snapshot.json` 里的价格动量信息,报告仍能生成。免费公共代理池可以作为应急补充,但不应当作稳定生产数据源;它有稳定性、数据污染、封禁、隐私和合规风险。更稳的做法是使用本组织已有价格快照、缓存文件,或可审计的自有代理/数据源。

docs/data_factor_roadmap.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ Priority order:
9393
returns, abnormal volume, drawdown, volatility, `market_score`, source, row
9494
count, and warnings. `scripts/build_market_confirmation.py` generates it from
9595
watchlists, saved signal context, and theme momentum snapshots; if the free
96-
price endpoint is unavailable, it falls back to saved theme momentum fields.
96+
price endpoint is unavailable, it can retry through `--proxy-urls`,
97+
`--proxy-list`, `--proxy-pool-url`, or the workflow variables
98+
`MARKET_DATA_PROXY_URLS` / `MARKET_DATA_PROXY_POOL_URL` before falling back to
99+
saved theme momentum fields.
97100
It must not contain target weights or trade instructions.
98101
4. Add event review inputs for 1/5/20/60 trading-day follow-up.
99102
5. Add fundamentals/valuation snapshots for risk explanation, not execution.

docs/data_factor_roadmap.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Crypto 可作为跨资产风险情绪参考,但暂时不应混入 US equity
180180
3.`QuantAdvisorResearch` 增加 market confirmation 输入,但保持可选:
181181
- 当前 CSV 字段为 `symbol,as_of,return_5d,return_20d,return_63d,relative_return_20d,relative_return_63d,volume_zscore,drawdown_63d,volatility_21d,market_score,data_source,price_observation_count,warnings`
182182
- `scripts/build_market_confirmation.py` 已能自动从 watchlist、信号上下文和主题动量快照收集标的,线上 workflow 默认生成该 CSV。
183+
- 支持 `--proxy-urls``--proxy-list``--proxy-pool-url` 和仓库变量 `MARKET_DATA_PROXY_URLS` / `MARKET_DATA_PROXY_POOL_URL` 作为免费公共代理池补充。
183184
- 如果免费行情接口不可用,脚本会退回到 `theme_momentum_snapshot.json` 中的价格动量字段;报告继续生成,但短线结论会更保守。
184185
- 该输入只影响 `final_decisions` 的短/中/长线审计评分,不包含目标仓位或交易指令。
185186

docs/notification_format.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ allocation advice.
2626
```text
2727
量化模型推荐 | 周度 | 2026-05-31
2828
29-
本期最终推荐
29+
本期推荐
3030
- MU | 中线 | 综合分=0.85 | 股票背景:Micron 主要做 DRAM、NAND 和 HBM 等存储芯片。
3131
推荐理由:前景主要来自 AI 服务器对 HBM 和高端 DRAM 的需求,以及存储周期修复。
3232
- INTC | 中线 | 综合分=0.77 | 股票背景:Intel 主要做 CPU、数据中心芯片、制造工艺和晶圆代工。
@@ -41,6 +41,6 @@ allocation advice.
4141
RSS remains intentionally short for feed readers:
4242

4343
```text
44-
主要信号=HBM / 存储, AI 算力平台;最终推荐=MU, INTC, AMD, VRT, DELL。
44+
主要信号=HBM / 存储, AI 算力平台;推荐=MU, INTC, AMD, VRT, DELL。
4545
非个性化模型输出;不包含下单、仓位配置或账户级建议。
4646
```

docs/notification_format.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ RSS 只放最短摘要,适合订阅器扫一眼:
5757

5858
```text
5959
标题:2026-05-30 周度模型推荐
60-
摘要:主要信号=HBM / 存储, AI 算力平台;最终推荐=MU, INTC, AMD, VRT, DELL。
60+
摘要:主要信号=HBM / 存储, AI 算力平台;推荐=MU, INTC, AMD, VRT, DELL。
6161
非个性化模型输出;不包含下单、仓位配置或账户级建议。
6262
链接:完整 HTML 报告
6363
```
@@ -69,7 +69,7 @@ Telegram 适合中等长度,最多展示前 3-5 个推荐:
6969
```text
7070
量化模型推荐 | 周度 | 2026-05-30
7171
72-
本期最终推荐
72+
本期推荐
7373
- MU | 中线 | 综合分=0.85 | 股票背景:Micron 主要做 DRAM、NAND 和 HBM 等存储芯片。
7474
推荐理由:前景主要来自 AI 服务器对 HBM 和高端 DRAM 的需求,以及存储周期修复。
7575
- INTC | 中线 | 综合分=0.77 | 股票背景:Intel 主要做 CPU、数据中心芯片、制造工艺和晶圆代工。

docs/system_design.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ The public HTML/RSS/Telegram outputs should stay direct:
9494

9595
- show final recommendations, horizons, stock background, recommendation reasons,
9696
and risks;
97+
- render public recommendations as long-, medium-, and short-horizon columns,
98+
sorted by each horizon score inside the column;
9799
- hide internal tags such as `source_mode`, mode labels, audience labels, and
98100
repository names;
99101
- keep `theme_first_candidates[]`, `horizon_scores`, and `selection_trace` in

0 commit comments

Comments
 (0)