OpenClaw
OpenClaw v3.1 · 系统原理说明 OpenClaw v3.1 · System Architecture Overview

一套自动化的
期权信号扫描引擎
An Automated
Options Signal Scanner

每日扫描美股期权市场,经过多层过滤筛选出符合 Wheel 卖 Put 策略的高质量信号,借助 Claude 进行解读,人工确认后作为投资参考。 Daily scans of U.S. options markets, applying multi-layer filters to surface high-quality Wheel Sell-Put signals. Claude AI interprets results; a human confirms before treating as investment reference.

5
全局风控关卡Global Risk Gates
120+
可扫描标的Scannable Tickers
6
单标的判断维度Per-Ticker Dimensions
4
合约硬性过滤条件Hard Contract Filters
Section 01

系统整体运行流程 System Overview Flow

整个系统的工作可以分为三个阶段:首先对市场宏观环境做全局判断,通过后才进入对每支标的的逐一扫描,最后将结果整理输出供 Claude AI 分析并给出开仓建议。 The system operates in three phases: first a global assessment of macro market conditions; only on passing does it proceed to scan each ticker individually; finally it compiles results for Claude AI analysis and position-opening recommendations.

🌐
阶段 01Phase 01
获取市场数据Fetch Market Data
VIX 恐慌指数
S&P500 均线状态
VIX Fear Index
S&P 500 MA Status
🔐
阶段 02Phase 02
全局风控门 (5关)Global Risk Gates (5)
任意一关不过则
终止全部扫描
Any failure halts
all scanning
🔍
阶段 03Phase 03
并发扫描标的Concurrent Scan
多线程同时处理
每支股票/ETF
Multi-thread per
stock / ETF
📋
阶段 04Phase 04
生成 LLM 报告Generate LLM Report
保存结构化 JSON
供 AI 分析
Save structured JSON
for AI analysis
🧠
阶段 05Phase 05
Claude AI 解读Claude AI Interprets
输出推荐信号
与开仓建议
Signal recommendations
and entry guidance

Section 02

第一道防线:全局风控门 First Line of Defense: Global Risk Gates

在扫描任何标的之前,系统先对整体市场环境做五项检查。任意一关失败,本轮扫描立即终止——无论个股情况多好,都不产生信号。这是防止在危险市场环境中错误开仓的核心机制。 Before scanning any ticker, the system performs five market-wide checks. Any single failure immediately halts the scan—no matter how strong individual stocks look, no signals are generated. This is the core mechanism preventing erroneous entries in dangerous market conditions.

1
市场状态检查Market Status Check
判断当前市场属于 A/B/C/D 哪个等级。只有在合适的市场状态(非 D 级极端风险状态)下才允许继续。 Determines current market grade A/B/C/D. Only appropriate grades (non-D extreme risk) permit continuation.
失败 → 立即终止Fail → Immediate halt
2
VIX 硬性上限VIX Hard Cap
实时获取 CBOE 恐慌指数。当 VIX 超过 35,市场波动性过高,卖 Put 的风险回报比不划算,直接停止。 Fetches CBOE fear index in real time. When VIX exceeds 35, volatility is too high; the risk/reward of selling puts is unfavorable.
VIX ≤ 35

失败 → 立即终止Fail → Immediate halt
3
VIX 期限结构VIX Term Structure
比较近月 VIX 与 3 个月 VIX。若近月 VIX 高于远月(倒挂),代表短期恐慌更高,系统自动收紧 Delta 上限,只选更保守的合约。 Compares near-month VIX with 3-month VIX. If inverted, near-term fear is elevated; the system automatically tightens the Delta ceiling to more conservative contracts.
VIX > VIX3M → Delta 收紧Delta tightened

仅调参,不终止Param adjust, no halt
4
账户保证金使用率Account Margin Utilization
检查当前账户已用保证金占比。超过 55% 表示仓位已偏重,再开仓风险过大,停止本轮扫描。 Checks ratio of margin used. Above 55% means positions are already heavy; adding more carries excessive risk. Scan halted.
已用保证金Used margin < 55%

失败 → 立即终止Fail → Immediate halt
5
三因子综合评分Three-Factor Composite Score
综合 VIX 水平、标普500 趋势、期限结构三个维度,计算宏观环境得分。得分低于 50 分时,整体市场条件不佳,终止扫描。 Combines VIX level, S&P 500 trend, and term structure into a macro environment score. Below 50 signals unfavorable conditions; scan halted.
得分Score ≥ 50

失败 → 立即终止Fail → Immediate halt

Section 03

第二道关卡:并发扫描每支标的 Second Gate: Concurrent Ticker Scan

全局风控门通过后,系统使用多线程技术同时处理所有标的——好比同时派出多个分析师,每人负责一支股票,大幅缩短总扫描时间。每支标的独立经历以下五个步骤: Once global risk gates pass, the system uses multi-threading to process all tickers simultaneously—like deploying multiple analysts in parallel, each covering one stock, dramatically cutting total scan time. Each ticker independently goes through five steps:

多线程并发示意图(各标的同时处理) Multi-thread concurrency diagram (all tickers processed simultaneously)
SPY
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
QQQ
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
AAPL
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
NVDA
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
NVO
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
MSFT
股价→IVR→财报检查→期权链→合约筛选 Price→IVR→Earnings→Chain→Filter
每支标的在独立线程中完成全部 5 个步骤,互不等待。扫描 120 个标的的耗时约等于扫描单个标的的时间(受 API 限速影响会有差异)。 Each ticker completes all 5 steps in its own thread without waiting on others. Scanning 120 tickers takes roughly the same wall-clock time as scanning a single one (subject to API rate-limit variance).
1
获取实时股价与均线 Fetch Real-time Price & Moving Averages
从数据源拉取当前股价、20 日均线、200 日均线等技术指标。若获取失败,该标的直接跳过,标记为 ERROR。 Pulls current price, 20-day MA, 200-day MA, and other technical indicators. If retrieval fails, the ticker is skipped and marked ERROR.
2
计算 IVR(隐含波动率排名) Calculate IVR (Implied Volatility Rank)
IVR = 当前 IV 在过去一年波动率区间中所处的百分位。

例如:当前 IV 为 35%,过去一年最低 20%、最高 80%,则 IVR = (35-20)/(80-20) × 100 = 25%

IVR 越高,代表目前 IV 相对较贵,卖出期权收到的权利金越丰厚。每支标的都有自己的 ivr_min 门槛(如 SPY 要求 ≥ 25%,AAPL 要求 ≥ 38%),低于门槛直接无信号

IVR 不足 是最常见的无信号原因
IVR = the percentile of current IV within the past year's IV range.

Example: current IV 35%, past-year low 20%, high 80% → IVR = (35−20)/(80−20) × 100 = 25%.

Higher IVR means current IV is relatively rich; premium collected from selling options is more generous. Each ticker has its own ivr_min threshold (e.g. SPY ≥ 25%, AAPL ≥ 38%); below threshold → no signal.

Insufficient IVR is the most common reason for no signal
3
检查财报与宏观事件黑名单 Check Earnings & Macro Event Blacklists
系统维护两类禁区,在禁区内的标的不产生任何信号:

财报黑名单:距离财报发布日不足 N 天(各标的不同,如 AAPL 为 10 天)。财报前期权价格会剧烈波动,风险失控。若财报日期获取失败,保守处理为「在禁区内」。

宏观事件黑名单:
The system maintains two blackout zones; tickers within them generate no signals:

Earnings blacklist: Within N days of earnings date (per-ticker; e.g. AAPL = 10 days). Options prices can swing wildly around earnings, making risk uncontrollable. If the earnings date cannot be fetched, treated conservatively as "inside blackout".

Macro event blacklist:
🏛️
FOMC 议息会议FOMC Meeting
会议前 3 天禁止3 days before prohibited
SPYQQQXLU
📊
CPI 通胀数据CPI Inflation Data
发布前 3 天禁止3 days before prohibited
宏观参考Macro Ref
👷
NFP 非农就业NFP Non-Farm Payrolls
发布前 3 天禁止3 days before prohibited
宏观参考Macro Ref
🏯
日本央行 BOJBOJ Bank of Japan
前后各 2 天禁止±2 days prohibited
EWJ
4
选取合适的期权到期日 Select Optimal Expiry
系统优先选取 DTE(距到期天数)在 35–45 天之间的合约(最优持仓窗口)。若无满足条件的日期,退而求其次扩展到 30–60 天(Fallback 区间)。若仍无合适到期日,该标的退出,不产生信号。

35–45 天 优先区间   30–60 天 备用区间
The system prefers contracts with DTE (Days to Expiry) between 35–45 days (optimal holding window). If none qualify, it falls back to 30–60 days. If still none, the ticker is dropped with no signal.

35–45 days Priority range   30–60 days Fallback range
5
拉取期权链并筛选合约 Fetch Option Chain & Filter Contracts
获取该到期日下所有 Put 合约的实时数据,包括行权价、买卖价差、Delta 值、持仓量等,然后进入下一节的四维过滤逻辑。 Retrieves real-time data for all Put contracts at the chosen expiry—strike, bid-ask spread, Delta, open interest, etc.—then applies the four-dimensional filter logic in the next section.

Section 04

第三道关卡:合约四维过滤 Third Gate: Four-Dimensional Contract Filter

在拿到期权链数据后,系统对每一张合约进行四个条件的同时检验。四个条件必须全部满足,才算「合格合约」。任意一条不过,该合约被直接淘汰。 After retrieving the option chain, the system tests every contract against four conditions simultaneously. All four must be satisfied for a contract to be considered "qualified." Failing any one disqualifies it immediately.

合格合约的四项硬性条件 Four Hard Conditions for a Qualified Contract
条件 1 · Delta 区间Condition 1 · Delta Range
Delta 须落在 -0.30 ~ -0.15 之间。Delta 代表期权的方向敏感度,此区间对应约 15%–30% 的被行权概率,是 Wheel 策略的「甜蜜区间」——既不太近(风险大)也不太远(权利金太低)。若市场期限结构倒挂,上限自动收紧至 -0.28。 Delta must fall between -0.30 ~ -0.15. Delta measures directional sensitivity; this range corresponds to ~15%–30% probability of assignment—the Wheel strategy's "sweet spot": not too close (high risk) nor too far (premium too low). If term structure is inverted, the ceiling auto-tightens to -0.28.
条件 2 · 年化收益率Condition 2 · Annualized Return
年化收益率 ≥ 各标的设定门槛。计算公式:(权利金 ÷ 行权价) × (365 ÷ DTE) × 100%。A+ 级标的门槛 10%,A 级 12%,C 级 15%。收益不达标的合约不值得开仓。 Annualized return ≥ per-ticker threshold. Formula: (premium ÷ strike) × (365 ÷ DTE) × 100%. A+ tickers: 10%, A tickers: 12%, C tickers: 15%. Contracts that don't meet the bar aren't worth entering.
条件 3 · 价外深度(OTM%)Condition 3 · OTM Depth
行权价距当前股价须有一定缓冲距离,通常要求 ≥ 6%–8%(各标的不同)。缓冲越大,股价下跌时被行权的概率越低,提供额外安全垫。 The strike must be a sufficient distance below the current price—typically ≥ 6%–8% (varies by ticker). A larger buffer means lower assignment probability if the stock falls, providing an additional safety cushion.
条件 4 · 流动性预筛Condition 4 · Liquidity Pre-screen
在进入四维筛选前,已预先淘汰:买卖价差超过中间价 15% 的合约(流动性差)、持仓量 OI 低于 50 手的合约(成交稀薄,不易成交)。 Before the four-dimensional filter, contracts already eliminated: bid-ask spread > 15% of mid-price (poor liquidity), open interest OI < 50 contracts (thinly traded; hard to fill).

筛选后,合格合约按以下优先级排序,最多取前 3 名推荐给 Claude: After filtering, qualified contracts are ranked by the following priorities, with the top 3 recommended to Claude:

优先级 1(主)Priority 1 (Primary)
OTM 深度Depth
越偏价外越安全Deeper OTM = safer
优先级 2(次)Priority 2 (Secondary)
年化收益Ann. Return
同等安全性下选收益更高的Choose higher yield at equal safety
优先级 3(末)Priority 3 (Tertiary)
持仓量Open Interest OI ↑
流动性更好,更易成交Better liquidity, easier to fill

Section 05

信号最终判定逻辑 Signal Final Determination Logic

每支标的完成全部步骤后,系统综合所有检查结果做最终判断。以下六个条件缺一不可——任意一个不满足,该标的显示「🔴 无合格合约」 After each ticker completes all steps, the system synthesizes all results into a final verdict. The following six conditions are all required—any single failure causes that ticker to show "🔴 No Qualified Contracts".

有效信号 = 以下六项条件全部为 TRUE Valid Signal = All six conditions TRUE
不在财报黑名单内(距财报 > earnings_blackout 天)Not on the earnings blacklist (> earnings_blackout days to earnings)
不在宏观事件黑名单内(FOMC / CPI / NFP / BOJ)Not on the macro event blacklist (FOMC / CPI / NFP / BOJ)
未触发特殊规则(如 GLD 在 VIX < 22 时禁止开仓)No special rule triggered (e.g., GLD prohibited when VIX < 22)
IVR 明确 ≥ 该标的 ivr_min 门槛(数据缺失也视为不通过)IVR definitively ≥ ticker's ivr_min threshold (missing data also counts as fail)
期权链中至少找到 1 个同时满足四维条件的合格合约At least 1 contract in the option chain simultaneously satisfies all four filter conditions
财报后 vol crush 窗口已过(如启用 --block-post-earnings 参数)Post-earnings vol crush window has passed (if --block-post-earnings flag is enabled)

Section 06

为什么大多数标的显示「无合格合约」? Why Do Most Tickers Show "No Qualified Contracts"?

这是正常的、有意为之的结果。系统的设计目标是宁可错过,不可做错——只在多重条件同时满足时才产生信号。以下是各类「淘汰」原因的详细解释: This is a normal, deliberate outcome. The system is designed around the principle of "rather miss than err"—signals are only generated when multiple conditions align simultaneously. Below is a detailed explanation of each elimination reason:

分类代码Category Code 淘汰原因Elimination Reason 含义Meaning 常见性Frequency
earn_bl 财报黑名单Earnings Blacklist 距离财报发布日不足设定天数,期权价格可能因业绩暴涨暴跌,卖 Put 风险不可控Within N days of earnings release; option prices may spike/crash on results, making sell-put risk uncontrollable ⭐⭐⭐ High
macro_bl 宏观事件窗口Macro Event Window FOMC / CPI / NFP / BOJ 等重大事件前后,市场波动不可预测FOMC / CPI / NFP / BOJ and similar major events create unpredictable market swings ⭐⭐ Medium
ivrl IVR 低于门槛IVR Below Threshold 当前期权权利金相对历史偏低,卖出期权的性价比不足,等待更好的时机Current option premium is relatively low historically; selling puts offers insufficient value—wait for a better setup ⭐⭐⭐ 最常见Most Common
ivu IVR 数据缺失IVR Data Missing 历史波动率数据不足,无法计算准确 IVR,系统保守处理为不通过Insufficient historical IV data to calculate accurate IVR; system conservatively treats as fail ⭐⭐ Medium
nc 真·无合格合约Truly No Qualified Contracts IVR 达标,但市场上没有同时满足 Delta + 年化收益 + OTM 深度三项条件的合约(可能因价差过宽或行权价稀疏)IVR passes, but no contract simultaneously satisfies Delta + annualized return + OTM depth (possibly due to wide spreads or sparse strikes) ⭐⭐ Medium
pebl 财报后 vol crushPost-Earnings Vol Crush 财报刚过,IV 急速下降,此时卖 Put 权利金锁定在低点,不划算(需启用对应参数)Earnings just released, IV collapsing rapidly; selling puts now locks in a low premium (requires flag to be enabled) Low

Section 07

最终输出格式与风控铁律 Final Output Format & Risk Rules

有信号的标的会生成标准格式的推荐卡片,同时系统强制执行以下风控规则,这些规则由 Claude AI 在分析时再次核查: Tickers with signals generate standardized recommendation cards. The system also enforces the following risk rules, which Claude AI re-validates during analysis:

🟢
有信号推荐格式 Signal Recommendation Format
  • 标的代码与等级(A+/A/B/C)Ticker symbol and grade (A+/A/B/C)
  • 推荐行权价与到期日期Recommended strike and expiry date
  • DTE(距到期天数)DTE (Days to Expiry)
  • 年化收益率与每张权利金Annualized return and per-contract premium
  • Delta 值(方向敏感度)Delta value (directional sensitivity)
  • 推荐结构(CSP / 价差)Recommended structure (CSP / Spread)
  • 推荐理由摘要Recommendation rationale summary
🔴
无信号时的跳过记录 Skip Record When No Signal
  • 跳过原因分类代码Skip reason category code
  • 具体数值(如当前 IVR 多少)Specific values (e.g., current IVR reading)
  • 距黑名单结束还有几天Days until blackout window ends
  • 当前最优合约参数(供参考)Best available contract params (for reference)
  • Opportunity Alert(机会预警)Opportunity Alert

风控铁律(Claude AI 在分析时强制执行) Risk Rules (Enforced by Claude AI during analysis)

R-01
单笔最大亏损 ≤ 账户净值 1%(用美元金额明确量化)Maximum loss per trade ≤ 1% of account NAV (quantified in dollar terms)
R-02
单一策略仓位 ≤ 账户净值 5%Single strategy position ≤ 5% of account NAV
R-03
同一标的持仓不超过 3 笔(避免集中暴露)No more than 3 open positions in the same ticker (avoids concentrated exposure)
R-04
财报日前 N 天(各标的不同)禁止开新仓No new entries within N days before earnings (per-ticker)
R-05
VIX > 30 时全部仓位规模减半;VIX > 35 时完全停止开仓When VIX > 30, halve all position sizes; when VIX > 35, stop all new entries
R-06
加密相关标的(IBIT / COIN / MSTR / HOOD / CRCL)合计不超过账户净值 4%Crypto-related tickers (IBIT / COIN / MSTR / HOOD / CRCL) combined ≤ 4% of NAV
R-07
所有信号为分析建议,最终必须在 IBKR 实盘界面人工核验后方可执行All signals are analytical suggestions; final execution requires manual verification in IBKR live account

Section 08

数据来源与降级机制 Data Sources & Fallback Mechanism

系统接入多个数据源,采用自动降级策略——主数据源不可用时自动切换备用源,保证扫描不中断。 The system connects to multiple data sources with an automatic fallback strategy—if the primary source is unavailable, it automatically switches to a backup, ensuring scans are never interrupted.

期权链数据Options Chain Data
Massive API → Tradier → CBOE → Alpaca → yfinance
股价 / 均线Price / Moving Averages
多源自动路由,优先低延迟源Multi-source auto-routing, lowest-latency priority
VIX / VIX3M
CBOE 官方Official → Polygon → yfinance
历史 IV 数据库Historical IV Database
本地 SQLite,每次扫描自动追加 ATM IV 快照Local SQLite, auto-appends ATM IV snapshot on each scan
免责声明
本文档仅用于系统原理说明与内部学习交流,不构成任何投资建议、要约或收益承诺。期权交易具有高风险,可能导致部分或全部本金损失。

文中涉及的参数、阈值、示例与流程均可能因市场波动、数据源延迟或缺失、接口异常及执行滑点而失效。任何交易决策须由使用者独立判断,并在券商终端进行最终核验。

使用者应自行承担由策略执行、风控设置、税务处理及合规义务产生的全部责任。过往表现不代表未来结果。
Disclaimer
This document is for system architecture explanation and internal learning only. It does not constitute any investment advice, solicitation, or promise of returns. Options trading carries significant risk and may result in partial or total loss of principal.

Parameters, thresholds, examples, and workflows described herein may be invalidated by market movements, data source delays or outages, API failures, and execution slippage. Any trading decision must be made independently by the user, with final verification in the broker's platform.

Users bear sole responsibility for all outcomes arising from strategy execution, risk configuration, tax treatment, and regulatory compliance. Past performance does not guarantee future results.