exposure-coach
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExposure Coach
Exposure Coach
Overview
概述
Exposure Coach synthesizes outputs from market-breadth-analyzer, uptrend-analyzer, macro-regime-detector, market-top-detector, ftd-detector, theme-detector, sector-analyst, and institutional-flow-tracker into a unified control-plane decision. The skill answers the solo trader's core question: "How much capital should I commit to equities right now?" before any individual stock analysis begins.
Exposure Coach 整合 market-breadth-analyzer、uptrend-analyzer、macro-regime-detector、market-top-detector、ftd-detector、theme-detector、sector-analyst 和 institutional-flow-tracker 的输出结果,形成统一的决策控制平面。该工具旨在解答独立交易者的核心问题:"当前我应该将多少资金投入股市?"——这一步应在进行个股分析前完成。
When to Use
适用场景
- Before initiating any new stock positions to determine appropriate capital commitment
- At the start of each trading week to calibrate portfolio exposure
- When multiple market signals conflict and a unified posture is needed
- After significant macro or market events to reassess exposure ceiling
- When transitioning between market regimes (broadening, concentration, contraction)
- 在建立任何新股票仓位前,确定合适的资金投入比例
- 每个交易周开始时,校准投资组合的敞口水平
- 当多个市场信号存在冲突,需要统一的市场态势判断时
- 重大宏观或市场事件发生后,重新评估敞口上限
- 市场状态切换时(如从集中化转为扩散化、收缩等)
Prerequisites
前置要求
- Python 3.9+
- FMP API key (set environment variable) for institutional-flow-tracker data
FMP_API_KEY - Input JSON files from upstream skills (see Workflow Step 1)
- Standard library + ,
argparse,jsondatetime
- Python 3.9及以上版本
- FMP API密钥(需设置环境变量),用于获取institutional-flow-tracker的数据
FMP_API_KEY - 上游工具生成的输入JSON文件(见工作流步骤1)
- 标准库 + 、
argparse、json模块datetime
Workflow
工作流
Step 1: Gather Upstream Skill Outputs
步骤1:收集上游工具输出
Collect the most recent JSON outputs from integrated skills. Each file provides a specific signal dimension:
| Skill | Output File Pattern | Signal Provided |
|---|---|---|
| market-breadth-analyzer | | Advance/decline ratios, new highs/lows |
| uptrend-analyzer | | Uptrend participation percentage |
| macro-regime-detector | | Current regime (Concentration, Broadening, etc.) |
| market-top-detector | | Distribution day count, top probability score |
| ftd-detector | | Failure-to-deliver anomalies |
| theme-detector | | Active investment themes and rotation |
| sector-analyst | | Sector performance rankings |
| institutional-flow-tracker | | Net institutional buying/selling |
收集各整合工具最新的JSON输出文件,每个文件提供特定维度的信号:
| 工具 | 输出文件格式 | 提供的信号 |
|---|---|---|
| market-breadth-analyzer | | 涨跌家数比、创新高/新低个股数量 |
| uptrend-analyzer | | 上涨趋势参与度百分比 |
| macro-regime-detector | | 当前市场状态(集中化、扩散化等) |
| market-top-detector | | 派发日数量、顶部概率评分 |
| ftd-detector | | 未交付(Failure-to-Deliver)异常情况 |
| theme-detector | | 活跃投资主题及风格切换 |
| sector-analyst | | 行业表现排名 |
| institutional-flow-tracker | | 机构资金净买入/卖出情况 |
Step 2: Run Exposure Scoring Engine
步骤2:运行敞口评分引擎
Execute the exposure scoring script with paths to upstream outputs:
bash
python3 skills/exposure-coach/scripts/calculate_exposure.py \
--breadth reports/breadth_latest.json \
--uptrend reports/uptrend_latest.json \
--regime reports/regime_latest.json \
--top-risk reports/top_risk_latest.json \
--ftd reports/ftd_latest.json \
--theme reports/theme_latest.json \
--sector reports/sector_latest.json \
--institutional reports/institutional_latest.json \
--output-dir reports/The script accepts partial inputs; missing files reduce confidence but do not block execution.
执行敞口评分脚本,并传入上游输出文件的路径:
bash
python3 skills/exposure-coach/scripts/calculate_exposure.py \
--breadth reports/breadth_latest.json \
--uptrend reports/uptrend_latest.json \
--regime reports/regime_latest.json \
--top-risk reports/top_risk_latest.json \
--ftd reports/ftd_latest.json \
--theme reports/theme_latest.json \
--sector reports/sector_latest.json \
--institutional reports/institutional_latest.json \
--output-dir reports/脚本支持部分输入;若缺少文件,会降低结果置信度,但不会终止执行。
Step 3: Interpret the Market Posture Summary
步骤3:解读市场态势总结
Review the generated posture report containing:
- Exposure Ceiling -- Maximum recommended equity allocation (0-100%)
- Bias Direction -- Growth vs Value tilt based on regime and flow
- Participation Assessment -- Broad (healthy) vs Narrow (fragile) market
- Action Recommendation -- NEW_ENTRY_ALLOWED, REDUCE_ONLY, or CASH_PRIORITY
- Confidence Level -- HIGH, MEDIUM, or LOW based on input completeness
查看生成的态势报告,内容包括:
- 敞口上限 —— 建议的最高股票配置比例(0-100%)
- 风格偏好 —— 基于市场状态和资金流向的成长与价值风格倾向
- 参与度评估 —— 广度(健康)或窄度(脆弱)市场
- 行动建议 —— NEW_ENTRY_ALLOWED、REDUCE_ONLY 或 CASH_PRIORITY
- 置信度等级 —— HIGH、MEDIUM 或 LOW,基于输入文件的完整性
Step 4: Apply Exposure Guidance
步骤4:应用敞口指导建议
Map the posture recommendation to portfolio actions:
| Recommendation | Action |
|---|---|
| NEW_ENTRY_ALLOWED | Proceed with stock-level analysis and new positions |
| REDUCE_ONLY | No new entries; trim existing positions on strength |
| CASH_PRIORITY | Raise cash aggressively; avoid all new commitments |
将态势建议映射到投资组合操作:
| 建议 | 操作 |
|---|---|
| NEW_ENTRY_ALLOWED | 继续进行个股分析并建立新仓位 |
| REDUCE_ONLY | 不新增仓位;在行情走强时减持现有仓位 |
| CASH_PRIORITY | 大幅增加现金持有;避免所有新的资金投入 |
Output Format
输出格式
JSON Report
JSON报告
json
{
"schema_version": "1.0",
"generated_at": "2026-03-16T07:00:00Z",
"exposure_ceiling_pct": 70,
"bias": "GROWTH",
"participation": "BROAD",
"recommendation": "NEW_ENTRY_ALLOWED",
"confidence": "HIGH",
"component_scores": {
"breadth_score": 65,
"uptrend_score": 72,
"regime_score": 80,
"top_risk_score": 25,
"ftd_score": 10,
"theme_score": 68,
"sector_score": 70,
"institutional_score": 75
},
"inputs_provided": ["breadth", "uptrend", "regime", "top_risk"],
"inputs_missing": ["ftd", "theme", "sector", "institutional"],
"rationale": "Broad participation with low top risk supports elevated exposure."
}json
{
"schema_version": "1.0",
"generated_at": "2026-03-16T07:00:00Z",
"exposure_ceiling_pct": 70,
"bias": "GROWTH",
"participation": "BROAD",
"recommendation": "NEW_ENTRY_ALLOWED",
"confidence": "HIGH",
"component_scores": {
"breadth_score": 65,
"uptrend_score": 72,
"regime_score": 80,
"top_risk_score": 25,
"ftd_score": 10,
"theme_score": 68,
"sector_score": 70,
"institutional_score": 75
},
"inputs_provided": ["breadth", "uptrend", "regime", "top_risk"],
"inputs_missing": ["ftd", "theme", "sector", "institutional"],
"rationale": "Broad participation with low top risk supports elevated exposure."
}Markdown Report
Markdown报告
The markdown report provides a one-page summary suitable for quick review:
markdown
undefinedMarkdown报告为一页式总结,便于快速查看:
markdown
undefinedMarket Posture Summary
Market Posture Summary
Date: 2026-03-16 | Confidence: HIGH
Date: 2026-03-16 | Confidence: HIGH
Exposure Ceiling: 70%
Exposure Ceiling: 70%
| Dimension | Score | Status |
|---|---|---|
| Breadth | 65 | Healthy |
| Uptrend Participation | 72% | Broad |
| Regime | Broadening | Favorable |
| Top Risk | 25 | Low |
| Dimension | Score | Status |
|---|---|---|
| Breadth | 65 | Healthy |
| Uptrend Participation | 72% | Broad |
| Regime | Broadening | Favorable |
| Top Risk | 25 | Low |
Recommendation: NEW_ENTRY_ALLOWED
Recommendation: NEW_ENTRY_ALLOWED
Bias: Growth > Value
Participation: Broad (healthy internals)
Bias: Growth > Value
Participation: Broad (healthy internals)
Rationale
Rationale
Broad participation with low distribution day count supports elevated equity exposure.
New positions allowed within the 70% ceiling.
Reports are saved to `reports/` with filenames `exposure_posture_YYYY-MM-DD_HHMMSS.{json,md}`.Broad participation with low distribution day count supports elevated equity exposure.
New positions allowed within the 70% ceiling.
报告将保存至`reports/`目录,文件名为`exposure_posture_YYYY-MM-DD_HHMMSS.{json,md}`。Resources
资源
- -- Main orchestrator that scores and synthesizes inputs
scripts/calculate_exposure.py - -- Scoring rules and threshold definitions
references/exposure_framework.md - -- Regime-to-exposure ceiling mappings
references/regime_exposure_map.md
- —— 主协调脚本,负责对输入进行评分与整合
scripts/calculate_exposure.py - —— 评分规则与阈值定义
references/exposure_framework.md - —— 市场状态与敞口上限的对应关系
references/regime_exposure_map.md
Key Principles
核心原则
- Safety First -- Default to lower exposure when inputs are incomplete or conflicting
- Regime Alignment -- Let macro regime set the baseline; breadth adjusts within bounds
- Actionable Output -- Always produce a clear recommendation, not just data aggregation
- 安全优先 —— 当输入不完整或存在冲突时,默认采用较低敞口建议
- 状态匹配 —— 以宏观市场状态为基准,通过市场广度在基准范围内调整敞口
- 输出可执行 —— 始终给出明确的建议,而非仅进行数据汇总