| name | ashare-sop-l1-macro-filter |
| description | L1 macro market filter for the A-share theme structure SOP engine. Use to determine whether the overall market environment supports trading — outputs 系统性风险/震荡市/多头趋势 and gates downstream modules. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["a-share","sop","macro-filter","l1","market-environment"],"related_skills":["a-share-theme-structure-sop","ashare-sop-l2-theme-engine"]}} |
A-Share SOP L1 — Macro Market Filter
Overview
This is the L1 tier of the A-share theme structure SOP engine (v1.7+). It decides whether the market environment supports trading and, if not, blocks all downstream buy signals globally.
Load this skill independently when you only need the macro environment assessment, or as part of the full SOP chain (L1→L2→L3→L4).
Engine Position
L1 (宏观市场过滤器) → gates → L2 (题材结构) → gates → L3 (个股共振) → feeds → L4 (执行复盘)
If L1 = 系统性风险, L2/L3 buy signal generation is globally disabled.
Data Sources
- 上证指数 (
000001.SH), 深证成指 (399001.SZ), 创业板指 (399006.SZ)
- Market-wide turnover (全市场成交额)
- Advance/decline ratio (涨跌家数比, sourced from daily mood scan in Obsidian)
npx -y westock-data-skillhub@1.0.3 kline sh000001,sz399001,sz399006 --period day --limit 60 --fq bfq
read /Users/gordon8018/obsidian_vault/gordon8018/Intel/30_Topics/AShare/<date>-ashare-market-mood.md
Environment States
| State | Trigger Conditions | Engine Impact |
|---|
| 系统性风险 (Systemic Risk) | Any major index meets one of: (1) intraday drop > 3%; (2) closes below MA20 for 3 consecutive days with MA20 sloping down; (3) sentiment enters "恐慌期" | Global Shield: Output "暂停交易", disable all L2/L3 buy signals |
| 震荡市 (Range-bound) | Indices between MA20 and MA60, or MA20/MA60 directions diverge | Reduced Weight: L2/L3 run but all candidate signals require stronger resonance to output |
| 多头趋势 (Bull Trend) | Indices close above MA20 AND MA60, both MAs sloping up | Normal Mode: L2/L3 operate at full standard rules |
MA20/MA60 Computation
From westock-data kline daily bars:
MA20 = simple moving average of close over last 20 trading days
MA60 = simple moving average of close over last 60 trading days
- "Direction up" = current MA > MA from 5 days ago
- "Direction down" = current MA < MA from 5 days ago
Sentiment "恐慌期" Detection
From the market mood scan in Obsidian:
- Read the "Breadth And Sentiment" table
- 恐慌期 indicators: extreme advance/decline ratio (e.g. >80% stocks declining), combined with elevated VIX-like indicators or consecutive days of broad selling
Output Format
When L1 is assessed independently, output:
## L1 宏观环境
- 当前状态:系统性风险 / 震荡市 / 多头趋势
- 判断依据:上证 MA20=XXX MA60=XXX, 深证 MA20=XXX MA60=XXX, 创业板 MA20=XXX MA60=XXX
- 成交额:XXXX 亿
- 涨跌比:XXXX up / XXXX down
- 对引擎影响:正常模式 / 降低权重 / 全局屏蔽
Automation
In the full SOP pipeline:
- Pre-market cron (
816138bf3403 at 08:30 Beijing): computes L1 state before generating watchlists
- Closing snapshot cron (
a16035d3b237 at 15:00 Beijing): re-evaluates L1 state with closing data
- When L1=系统性风险, the pipeline skips buy candidate generation entirely
Common Pitfalls
- Skipping L1 entirely: Never generate buy candidates without first checking L1 state. A strong L2 theme in a crashing market is not actionable.
- Using intraday MA without closing confirmation: MA20/MA60 are computed from daily closes. Intraday violations of MA thresholds should be treated as warnings, not confirmed states, until close.
- Overriding L1 shield manually: L1=系统性风险 means global shield. Do not manually override because "this one stock looks good."
Verification Checklist