OpenClaw v4.4 · · 期权卖 Put 策略引擎 Options Sell-Put Strategy Engine
中文
EN
私有量化策略系统 · 期权卖方引擎
Private Quant System · Options Seller Engine

OpenClaw

一套面向个人投资者的美股期权策略引擎。扫描器执行全量规则过滤,AI 策略副官完成叙事解读与信号排序,飞书 / Telegram 双推,人工在 IBKR 最终下单。

A US-options strategy engine for individual investors. The scanner runs full rule filtering; the AI Adjutant ranks signals and narrates market context; Lark / Telegram dual-push; human final execution in IBKR.

策略类型 Strategy Wheel / CSP / Bull Put Spread
标的池 Universe 100+ 标的并发扫描 100+ Tickers Concurrent
AI 接口 AI Interface DeepSeek / GPT-compatible
账户 Broker IBKR Portfolio Margin
版本 Version v4.4 · 2025
01
系统解决什么问题
What Problems This System Solves
规则纪律 · 信息降噪 · AI 增量价值
Rule Discipline · Signal Denoising · AI Incremental Value
◆
核心定位:卖 Put 策略在逻辑上简单,但执行上极度依赖纪律、规则和时机判断,人工操作容易陷入"随机开仓"和"情绪化决策"。OpenClaw 将这套判断体系系统化、自动化,同时保留人工最终决策权。 Core Positioning: Selling puts is logically simple but relies heavily on discipline, rules, and timing. Manual execution leads to random entries and emotional decisions. OpenClaw systematizes this judgement while preserving human final authority.
标的池规模
Universe Size
100+
并发扫描,自动降级回退
Concurrent scan, auto fallback
VIX 熔断阈值
VIX Hard Limit
35
超过即全面停止开仓
No new positions above this
推送渠道
Push Channels
3
飞书 · Telegram · Bark
Lark · Telegram · Bark
1
规则纪律化
Rule Discipline
硬编码风控规则
Hardcoded Risk Controls
VIX 阈值、财报黑名单、IVR 筛选、行业集中度上限、加密池占比等全部硬编码,每次扫描自动执行,杜绝"这次例外"的侥幸心理。
VIX thresholds, earnings blacklist, IVR filters, sector concentration caps, crypto bucket limits — all hardcoded. Executed automatically each scan with zero exceptions allowed.
2
信息降噪
Signal Denoising
压缩为一份报告
Compressed to One Report
100+ 标的全量扫描压缩为结构化 JSON,AI 做跨信号优先级排序,用户只需每天花 5 分钟审阅一份报告做最终决策。
100+ tickers compressed into structured JSON; AI ranks signals by priority. Users review one report in ~5 minutes and make the final call.
3
AI 增量价值
AI Incremental Value
做规则引擎做不到的事
Beyond What Rules Can Do
AI 不做规则核对(扫描器已完成),专注市场叙事、组合相关性、边缘标的前瞻、时序模式识别——这些是规则引擎无法完成的工作。
AI doesn't re-check rules (scanner handles that). It focuses on market narrative, correlation across signals, near-miss tickers, and temporal pattern recognition.
4
全渠道通知
Omni-Channel Alerts
通知不断流
Uninterrupted Delivery
飞书 interactive 卡片、Telegram 文本、Bark iOS。AI 超时或失败时自动降级为原始扫描摘要推送,确保通知不断流。
Lark interactive card, Telegram text, Bark iOS. If AI fails, auto-degrades to raw scan summary — zero notification gaps.
5
人工保留决策权
Human Retains Authority
系统不接触下单接口
No Auto-Execution
系统明确不接触 IBKR 下单接口,最终审阅后人工在 IBKR 执行。AI 不下单、不超清单范围、不放宽任何硬底线。
System never touches the IBKR order API. Human reviews and places orders manually. AI cannot trade, expand the ticker list, or soften hard limits.
6
历史归档 · 趋势洞察
Archive & Trend Insights
7-14 天时序分析
7-14 Day Time-Series Analysis
每次扫描归档元数据,AI 时序分析师从历史读出信号密度趋势、账户演变、异常模式,辅助规则校准。
Each scan archives metadata. The AI Trend Analyst reads signal density trends, account evolution, and anomaly patterns to inform rule calibration.
02
三模块流水线架构
Three-Module Pipeline Architecture
Scanner → Analyzer → Pipeline 顺序串联执行
Scanner → Analyzer → Pipeline executed sequentially
① Scanner openclaw_scan.py

期权链扫描 · 规则过滤 · 输出紧凑 JSON。系统的数据与规则层,决定"哪些标的今天值得看"。

Options chain scanning · rule filtering · compact JSON output. The data and rules layer deciding "which tickers are worth considering today."

1
市场环境检测 Market Environment Check 获取 VIX / VIX3M / SP500,计算 Gate Score,任一硬门槛不过即短路 Fetch VIX / VIX3M / SP500, compute Gate Score; any hard gate failure short-circuits the run
2
多源数据拉取(自动回退) Multi-Source Data Pull (Auto Fallback) IBKR → CBOE → Alpaca → Tradier → yfinance 优先级回退链 IBKR → CBOE → Alpaca → Tradier → yfinance priority fallback chain
3
100+ 标的并发处理 100+ Tickers Concurrent Processing ThreadPoolExecutor 并发,财报黑名单、宏观事件窗口、IVR 逐一核验 ThreadPoolExecutor concurrency; earnings blacklist, macro event window, IVR validated per ticker
4
合约筛选 + 账户饱和检查 Contract Filtering + Account Saturation Check Delta 区间、年化收益、OI 门槛;行业集中度、加密池、单标名义上限 Delta range, annualized yield, OI threshold; sector concentration, crypto bucket, single-ticker notional cap
5
输出紧凑 JSON → 管道传入分析器 Output Compact JSON → Pipe to Analyzer m(元数据)· sig(通过信号)· skip(跳过统计)三块结构 Three blocks: m (metadata) · sig (passed signals) · skip (rejection stats)
IBKR Gateway CBOE Delayed Alpaca Paper Tradier yfinance Finnhub (Earnings)
② Analyzer openclaw_analyze.py

AI 决策端。读入扫描 JSON,Python 层预处理后送 LLM,输出策略报告 + 飞书推送卡片。

AI decision layer. Reads scan JSON, Python pre-processes, sends to LLM, outputs strategy report + Lark push card.

1
Python 层预处理 Python Pre-Processing 信号分层、板块聚集、加密重叠、边缘候选池——"脏活"在 Python 层提前算好 Signal tiering, sector clustering, crypto overlap, near-miss pool — computed in Python before LLM call
2
结构化 JSON 模式(v4.0) Structured JSON Mode (v4.0) response_format=json_object,输出 snapshot / ranked_signals / tactical / stress_lite 等字段 response_format=json_object, outputting snapshot / ranked_signals / tactical / stress_lite fields
3
时序趋势分析(消息 2) Time-Series Trend Analysis (Msg 2) 读取 7-14 天归档,temperature=0.5,识别跨日信号模式、账户演变、异常聚集 Reads 7-14 day archives, temperature=0.5, identifies cross-day patterns, account evolution, anomalies
4
持仓两轮审查 Two-Round Position Review 第1轮出问题清单,第2轮对每个问题深度分析;结构化输出 positions_to_watch Round 1 generates question list; Round 2 deep-analyzes each issue; structured output of positions_to_watch
OpenAI 兼容接口 OpenAI-compatible API AI_MODEL + FALLBACK temperature 0.2–0.5 思维链剥离 Chain-of-thought stripped
③ Pipeline openclaw_pipeline.py

编排器。串联 Scanner 和 Analyzer,管理双消息推送、历史归档、降级兜底、文件清理。

Orchestrator. Chains Scanner and Analyzer, manages dual-message push, history archiving, graceful degradation, file cleanup.

  • 从 stdin 或 --scan-file 读取扫描 JSON(支持历史回放)
  • Reads scan JSON from stdin or --scan-file (historical replay supported)
  • 生成消息 1(今日商机报告)→ 归档元数据 → 推送消息 1(间隔 1.5s 防限流)
  • Generate Msg 1 (today's opportunity report) → archive metadata → push Msg 1 (1.5s gap to avoid rate limit)
  • 加载近 14 天历史 → 生成消息 2(AI 时序分析)→ AI 失败降级为数值对比 fallback
  • Load 14-day history → generate Msg 2 (AI trend analysis) → fallback to numeric comparison on AI failure
  • cleanup_old_files 清理超过保留期的归档文件(默认 730 天)
  • cleanup_old_files purges archives beyond retention window (default 730 days)
→
最终步骤(用户):收到飞书 / Telegram / Bark 推送后,审阅 AI 报告,确认优先信号,前往 IBKR 人工下单。系统不自动下单,不放宽硬底线。 Final Step (User): After receiving Lark / Telegram / Bark push, review AI report, confirm priority signals, manually place orders in IBKR. System never auto-trades or softens hard limits.
03
5 项市场准入门槛
5 Pre-Screen Gates
任一不过即短路,不拉期权链
Any failure short-circuits — no options chain fetch
⚠
设计原则:Gate 执行成本极低(无需拉期权链),任一门槛不通过即立即返回,全量扫描随之中止。VIX 35 是唯一不可软化的绝对熔断阈值,AI 也无权建议放宽。 Design Principle: Gates are nearly zero-cost (no options chain fetch needed). Any failure immediately returns. VIX 35 is the sole absolute circuit-breaker threshold — AI cannot suggest relaxing it.
Gate-1
市场状态
Market Regime
SP500 在 200 日均线下方 且 20 日回撤超 10% → 市场 D 级,直接否决。两者须同时满足才触发,单独低于均线仅警告。
SP500 below 200-day MA AND 20-day drawdown >10% → Market Grade D, rejected. Both conditions must be met; failing MA alone only issues a warning.
Gate-2
VIX 硬上限
VIX Hard Ceiling
VIX > 35 时绝对禁止卖出任何期权。唯一不可软化的熔断阈值,AI 无权建议放宽,无任何例外。
VIX > 35 absolutely prohibits selling any options. The sole non-negotiable circuit-breaker. AI cannot suggest relaxation; no exceptions.
Gate-3
VIX 期限结构(倒挂监控)
VIX Term Structure (Inversion Monitor)
VIX > VIX3M(期限倒挂)时,DELTA_MIN 自动收紧 +0.02,排除最激进 Delta 端。不直接否决,但隐含风险偏好收紧。
VIX > VIX3M (term inversion): DELTA_MIN auto-tightens by +0.02, removing the most aggressive delta range. Not a direct rejection, but implicitly tightens risk appetite.
Gate-4
保证金使用率
Margin Utilization
通过 --margin-used 传入当前使用率(%);≥ 55% 时禁止新开仓。未传入时由 Flex EOD 数据估算;仍缺失则跳过并标注需人工确认。
Passed via --margin-used (%); ≥ 55% blocks new positions. If absent, estimated from Flex EOD data; still missing → gate skipped and flagged for manual confirmation.
Gate-5
三因子综合评分
Three-Factor Composite Score
VIX 区间(0-35分)+ SP500 位置(0-30分)+ 期限结构(0-25分)→ 总分 < 50 否决。Gate score 写入 m.gate_score 供 AI 解读。
VIX range (0-35 pts) + SP500 position (0-30 pts) + term structure (0-25 pts) → total < 50 rejected. Gate score written to m.gate_score for AI reference.
04
扫描输出 JSON 格式
Scan Output JSON Format
m / sig / skip 三块顶层结构
Three top-level blocks: m / sig / skip
// 每次扫描通过 stdin 管道传入分析器 // Piped to analyzer via stdin each scan run { "m": { // meta 元数据// metadata "ts": "2025-01-15 09:32", "ver": "v4.4", "scope": "full", "sig_cnt": "3/112", "vix": 22.5, "vix3m": 23.1, "gates_ok": true, "gate_score": 72, "acct": { "nlv": 185000, "put_notional_pct": 41, "crypto_pct": 2.1 } }, "sig": [{ // 通过筛选的信号列表// signals that passed all filters "tkr": "AAPL", "g": "A", "px": 228.5, "ivr": 44, "ivs": "real", "off": true, "c": [{ "k":205, "del":-0.19, "yld":13.2, "otm":10.2, "prem":1.45 }] }], "skip": { // 跳过原因统计// rejection reason counters "count":109, "ebl":28, "ivrl":41, "nc":15, "fomc":3 } }

跳过原因编码(Skip Codes)

Skip Codes

nc无合格合约No qualifying contract
ebl财报窗口阻断Earnings blackout
eunk财报日期未知Unknown earnings date
ivrlIVR 低于门槛IVR below threshold
ivuIVR 数据缺失IVR data unavailable
rule特殊规则阻断Special rule block
gldGLD VIX 闸门GLD VIX gate
fomcFOMC 窗口FOMC window
cpiCPI 发布窗口CPI release window
nfp非农发布窗口NFP release window
bojBOJ 决议窗口BOJ decision window
drop机遇提示Near-miss opportunity
05
可自动执行的特殊规则
Auto-Executed Special Rules
在标准过滤之外针对特定标的的额外规则
Per-ticker rules beyond the standard filter pipeline

gld_vix_gate

VIX < 22 时禁止开 GLD 的 Put;VIX > 22 或地缘事件触发才允许。VIX < 18 绝对禁止。

Put on GLD blocked when VIX < 22; allowed only when VIX > 22 or geo-event triggered. VIX < 18 is absolute prohibition.

btc_above_ma50

COIN / HOOD 等加密标的要求 BTC 收盘价在 50 日均线上方,否则阻断信号输出。

Crypto-linked tickers (COIN / HOOD etc.) require BTC closing above its 50-day MA, otherwise signal blocked.

btc_drop_8_block

BTC 当日跌幅超 8% 时立即阻断 HOOD 等加密相关标的,防止在极端行情下开仓。

BTC single-day drop >8% immediately blocks HOOD and crypto-adjacent tickers to avoid opening in panic conditions.

require_above_ma200

TSLA 等标的要求股价在 200 日均线上方;跌破则阻断信号,降低趋势做空风险。

Tickers like TSLA require price above 200-day MA. Break below blocks the signal to reduce shorting into a downtrend.

oi_min_5000

CRCL / HOOD 等新标的要求候选合约中至少一个 OI ≥ 5000,确保流动性充足。

New tickers (CRCL / HOOD etc.) require at least one candidate contract with OI ≥ 5,000 to ensure adequate liquidity.

crypto_bucket_cap_4pct

IBIT / COIN / MSTR / HOOD / CRCL / MARA 合计名义暴露不超过账户净值 4%。

IBIT / COIN / MSTR / HOOD / CRCL / MARA combined notional exposure capped at 4% of account NLV.

◈
AI 硬约束(不可越界):AI 不推荐清单外标的 · 不建议放宽 VIX 35 / 加密池 4% / Put 名义 150% / 单标 10% / 行业 30% 等硬上限 · 不给具体张数 · gates_ok=false 时不建议任何新开仓 · 不编造数值。 AI Hard Constraints (non-negotiable): AI cannot recommend off-list tickers · cannot suggest relaxing VIX 35 / crypto 4% / put notional 150% / single ticker 10% / sector 30% · cannot specify lot sizes · cannot suggest new positions when gates_ok=false · cannot fabricate values.
06
AI 的四个角色
The Four AI Roles
策略副官 · 时序分析师 · 结构化输出 · 持仓审查
Strategy Adjutant · Trend Analyst · Structured Output · Position Reviewer
1
消息 1 · 策略副官
Msg 1 · Strategy Adjutant
市场叙事 + 信号排序
Market Narrative + Signal Ranking
  • VIX / Gate / 信号密度 → 今日整体可交易性判断
  • VIX / Gate / signal density → today's overall tradability
  • 跨信号比较,综合年化 · 层级 · 相关性排序
  • Cross-signal comparison, ranking by yield · tier · correlation
  • 战术节奏:VIX 25-30 → 缩量 ×0.7;加密重叠 → 只选一个
  • Tactical cadence: VIX 25-30 → scale ×0.7; crypto overlap → pick one only
  • 边缘观察:IVR 差 2 点未触发 · 财报后解锁队列
  • Near-miss watch: IVR 2 pts short · post-earnings unlock queue
2
消息 2 · 时序分析师
Msg 2 · Trend Analyst
7-14 天趋势 + 模式识别
7-14 Day Trends + Pattern Recognition
  • 信号密度方向与 VIX 走向相关性分析
  • Signal density direction vs. VIX trend correlation
  • 账户演变:NLV 曲线 · Put 名义占比动态
  • Account evolution: NLV curve · Put notional % dynamics
  • 异常模式:连续 0 信号 · 板块聚集 · 财报密集期
  • Anomaly patterns: consecutive zero-signal days · sector clustering · earnings-dense periods
  • temperature=0.5,描述现象,不直接改阈值建议
  • temperature=0.5, describes phenomena without directly suggesting threshold changes
3
结构化输出 v4.0
Structured Output v4.0
JSON Schema 精确解析
JSON Schema Precise Output
  • snapshot · market_narrative · ranked_signals
  • tactical · stress_lite · portfolio_greeks_comment
  • ranked_signals 写回 signals_archive.jsonl 供时序引用
  • ranked_signals written back to signals_archive.jsonl for trend reference
  • 思维链 <think>...</think> 引导分析后剥离,不污染报告
  • Chain-of-thought <think>...</think> guides analysis then stripped from report
4
持仓审查 · 两轮 LLM
Position Review · Two-Round LLM
提问 → 深度建议
Question → Deep Analysis
  • 第1轮:生成问题清单(DTE / Delta 扩大 / Vega 方向)
  • Round 1: Generate question list (DTE / delta expansion / Vega direction)
  • 第2轮:逐一深度建议,输出 positions_to_watch
  • Round 2: Deep suggestions per question, outputs positions_to_watch
  • 组合 Greeks:Delta / Vega 方向 + 行业集中度分析
  • Portfolio Greeks: Delta/Vega direction + sector concentration analysis
  • 接货超 $60K → 标注 NRA 遗产税红线警告
  • Assignment >$60K → flags NRA estate tax red-line warning
07
标的分级与策略参数
Ticker Grading & Strategy Parameters
A+ / A / B / C / D 五层分级,参数自动匹配
Five tiers A+ / A / B / C / D with auto-matched parameters
层级Tier 典型标的Examples IVR 门槛IVR Min 年化最低Min Yield 财报窗口Earnings Block 结构要求Structure
A+ A+ SPY · QQQ · EWJ · IWM 25-30%25-30% 8-10%8-10% 无(ETF)None (ETF) CSP / SpreadCSP / Spread
A A AAPL · MSFT · MA · JPM · LLY 30-45%30-45% 10-13%10-13% 前 7-10 天T-7 to T-10 CSP · WheelCSP · Wheel
B B GLD · V · XLU · COST · LMT 26-38%26-38% 7-12%7-12% 前 10 天T-10 CSPCSP
C C META · NVDA · TSLA · COIN · AMD 55-85%55-85% 15-25%15-25% 前 14 天T-14 强制 Bull Put SpreadMandatory Bull Put Spread
D D TSLA · COIN · SMCI · HOOD 65-80%65-80% 15%15% 前 14 天T-14 Spread 宽 $15-30Spread width $15-30
ℹ
C / D 层标的有硬张数上限:MSTR ≤ 1 张,TSLA ≤ 2 张。D 层标的仅在 20tickers 模式下扫描,安全垫须达 22-24%。 C/D tier tickers have hard lot caps: MSTR ≤ 1, TSLA ≤ 2. D-tier tickers only scanned in 20tickers mode; safety cushion must be 22-24%.
08
适用人群
Target Users
谁能从中获益 / 谁不适合
Who benefits / who doesn't

✓ 适合的用户

✓ Good Fit

  • 已有卖 Put / Wheel / CSP 实盘经验,理解期权基本原理
  • Prior live experience with selling puts / Wheel / CSP; understands options fundamentals
  • IBKR Portfolio Margin 账户,净值建议 $100K+
  • IBKR Portfolio Margin account, NLV recommended $100K+
  • 希望将"选标的·看时机"系统化,同时保留人工下单决策权
  • Wants to systematize ticker selection and timing while retaining manual order authority
  • 能自行配置 Python 环境、.env 文件、API Key 和 cron 调度
  • Can self-configure Python env, .env files, API keys, and cron scheduling
  • 规则不稳定的执行者:希望把"这次要不要例外"变成硬规则
  • Inconsistent rule followers who want "should I make an exception this time" removed from the decision
  • 多标的覆盖但精力有限:每天花 5-10 分钟审阅后下单
  • Multi-ticker coverage with limited time: 5-10 min daily review before ordering

✕ 不适合的用户

✕ Poor Fit

  • 期待系统自动下单、不需要人工介入
  • Expects auto-execution with no human involvement
  • 不理解期权原理,只想跟信号"照单执行"
  • Doesn't understand options mechanics; just wants to copy signals blindly
  • 账户资金过小($20K 以下,一手 CSP 就撑满比例)
  • Account too small (below $20K — one CSP contract fills the notional cap)
  • 无法自行部署 Python 脚本和配置环境变量
  • Cannot self-deploy Python scripts or configure environment variables
  • 期望系统帮助做多头 / 买 Call 等方向性策略
  • Wants help with long-side / buy-call directional strategies
  • 对延迟行情不可接受(CBOE Delayed 存在数分钟延迟)
  • Cannot tolerate delayed quotes (CBOE Delayed has a few-minute lag)
09
技术规格
Technical Specifications
依赖、接口、数据与推送
Dependencies, interfaces, data & push

运行时 / 依赖

Runtime / Dependencies

  • Python 3.11+
  • requests · pandas · numpy
  • yfinance · ib_insync
  • SQLite iv_history.db(IVR 历史)
  • SQLite iv_history.db (IVR history)

LLM 接口

LLM Interface

  • OpenAI 兼容接口(可替换)
  • OpenAI-compatible API (swappable)
  • 主模型 + 逗号分隔 fallback 列表
  • Primary model + comma-separated fallback list
  • DeepSeek / GPT / Claude 等均可
  • DeepSeek / GPT / Claude all compatible

期权数据链

Options Data Chain

  • IBKR Gateway(首选)
  • CBOE Delayed(次选)
  • Alpaca Paper → Tradier
  • yfinance(最终回退)

账户集成

Account Integration

  • IBKR Flex EOD Report
  • NLV · 持仓暴露 · Put 名义
  • NLV · position exposure · put notional
  • 加密池占比 · 饱和度检查
  • Crypto bucket % · saturation check

通知推送

Push Notifications

  • 飞书 interactive 卡片(lark_md)
  • Lark interactive card (lark_md)
  • Telegram Bot API
  • Bark iOS Push
  • AI 失败 → 原始摘要降级
  • AI fail → raw summary fallback

并发 & 存储

Concurrency & Storage

  • ThreadPoolExecutor(默认 2 线程)
  • ThreadPoolExecutor (default 2 threads)
  • scan_history 目录归档元数据
  • scan_history directory archives metadata
  • signals_archive.jsonl 时序数据
  • signals_archive.jsonl for time-series data
  • 默认保留 730 天,自动清理
  • Default 730-day retention, auto-purge
⚙
部署方式:配置 .env 环境变量(LLM Key · Tradier · Finnhub · 飞书 Webhook),在 Python 环境中运行,通过 cron 定时调度。支持 --scope full 全量和 --scope 20tickers 精选两种扫描模式。 Deployment: Configure .env variables (LLM Key · Tradier · Finnhub · Lark Webhook), run in Python environment, schedule via cron. Supports --scope full (all tickers) and --scope 20tickers (curated) scan modes.
系统设计理念
Design Philosophy

"规则引擎负责纪律,AI 负责叙事,人类负责决定。三者各司其职,才是可以长期运行的系统。"

"The rules engine owns discipline. The AI owns narrative. The human owns the decision. Each in its lane — that's a system that runs indefinitely."

免责声明 Disclaimer
本文档仅作系统功能介绍,不构成任何投资建议。期权交易存在本金全部损失的重大风险。过往信号统计不代表未来收益。交易者须自行评估风险承受能力,并对一切投资决策承担完全责任。 This document is for system feature presentation only and does not constitute investment advice. Options trading involves substantial risk of total capital loss. Past signal statistics do not represent future returns. Traders must independently assess their own risk tolerance and bear full responsibility for all investment decisions.

OpenClaw v4.4 · 2025 · Private Use Only