跳到主内容
@wquguru
精选88Roan研究与分析

用Black-Scholes模型交易:从定价到希腊字母实战复盘

How i trade with the Black-Scholes Model:

原文
发到 X
推荐理由

提供了一套完整的期权定价与希腊字母监控实操方法论,包含具体技术栈与风控逻辑,适合衍生品交易者参考。

How i trade with the Black-Scholes Model:

我如何使用 Black-Scholes 模型进行交易:

i built Black-Scholes from SCRATCH six months into my quant journey

在我的量化旅程开始六个月后,我是从零开始构建 Black-Scholes 模型的

the formula everyone learns in school, the one that won Merton and Scholes a Nobel, i figured if it was famous enough to have a Nobel, it was famous enough to trust

这是每个人在学校里学到的公式,也是让 Merton 和 Scholes 获得诺贝尔奖的那个公式。我想,如果它有名到足以获得诺贝尔奖,那它就足够值得信赖。

that was my first MISTAKE

这是我的第一个错误

here's what i actually learned from building it, using it, and losing money with it

以下是我在构建、使用并因此亏损的过程中真正学到的东西

the build:

构建过程:

Black-Scholes takes 5 inputs and outputs an option price, that's stock price, strike price, time to expiry, risk-free rate and volatility

Black-Scholes 需要 5 个输入并输出期权价格,分别是:股票价格、行权价、到期时间、无风险利率和波动率

tech stack i used:

我使用的技术栈:

> Python 3.11 as the base language > scipy(dot)stats for the normal cumulative distribution function > numpy for the vectorized math when i extended it across multiple strikes > yfinance to pull SPY option chain data for backtesting > matplotlib for the initial visualization

> Python 3.11 作为基础语言 > scipy.stats 用于正态累积分布函数 > numpy 用于当我将其扩展到多个行权价时的向量化数学运算 > yfinance 用于获取 SPY 期权链数据进行回测 > matplotlib 用于初始可视化

the entire pricing engine was around 40 lines of Python, i wrote it in a jupyter notebook first, then moved it into a proper module once i started using it for real trades

整个定价引擎大约只有 40 行 Python 代码。我最初在 Jupyter Notebook 中编写它,然后在我开始用它进行真实交易时,将其移入了一个正式的模块中。

when i first ran it and compared to real SPY option prices, the model was within 2-3% on liquid at-the-money options with 30-90 days to expiry

当我第一次运行它并与真实的 SPY 期权价格进行比较时,对于剩余到期时间为 30-90 天的流动性好的平值期权,模型的误差在 2-3% 以内

i thought i had cracked the CODE

我以为我破解了密码

what actually worked:

实际有效的部分:

pricing accuracy on at-the-money SPY options was solid enough that i could use the model as a reference, not as gospel, but as a check against what the market was showing me

对 SPY 平值期权的定价准确性足够可靠,使我能够将模型用作参考,而不是当作绝对真理,而是作为一种检查市场向我展示的内容的手段

the GREEKS were the real win tho

但真正的胜利在于希腊字母(Greeks)

i extended the code to output all 4 first-order Greeks from the same closed-form formula:

我将代码扩展为从同一个闭式公式输出所有 4 个一阶希腊字母:

> delta = how much the option moves for a $1 stock move > gamma = how fast delta itself changes as the stock moves > theta = the daily cost of holding the position from time decay > vega = sensitivity to a 1% change in implied volatility

> delta = 股票价格变动 1 美元为期权带来的变动量 > gamma = 随着股票价格变动,delta 本身的变化速度 > theta = 因时间衰减而持有头寸的每日成本 > vega = 隐含波动率变化 1% 时的敏感度

i built a simple streamlit dashboard on top of the pricing engine that showed all 4 Greeks on my open positions in real time, refreshed every 30 seconds against live yfinance data

我在定价引擎之上构建了一个简单的 Streamlit 仪表板,实时显示我未平仓头寸的所有 4 个希腊字母,每 30 秒根据实时的 yfinance 数据刷新一次

for the first time i actually understood WHY my positions were moving the way they were

我第一次真正理解了为什么我的头寸会以那种方式变动

what broke, expensively:

昂贵地崩盘的部分:

my first real trade was SPY puts before a Fed meeting

我的第一笔真实交易是在美联储会议前买入 SPY 看跌期权

i used 14% historical vol as my sigma, model priced the puts at $2.85, live market at $3.40

我使用 14% 的历史波动率作为 sigma,模型给看跌期权定价为 2.85 美元,而实时市场价格为 3.40 美元

implied vol had already jumped to 22% ahead of the print

在数据发布前,隐含波动率已经跳升至 22%

market dropped 2% like i expected, my model P&L said i should be up 60%, i closed up 28%

市场如我所料下跌了 2%,我的模型盈亏(P&L)显示我应该盈利 60%,但我实际只盈利了 28%

IV CRASHED from 22% to 13% the moment the Fed resolved, my puts lost the vega premium even though the direction was right

美联储决议落地后,IV 从 22% 暴跌至 13%,我的看跌期权即便方向判断正确,也损失了 vega 溢价

lesson: Black-Scholes assumes constant vol, real markets don't work like that

教训:Black-Scholes 假设波动率恒定,但真实市场并非如此运作

the other assumptions broke too:

其他假设也失效了:

> log-normal returns fail on tail events, this is why the vol smile exists > no-dividends assumption cost me on ex-dividend dates, my code didn't adjust for it > frictionless markets are a joke, my real fills were 5-10% worse than mid-price

> 对数正态收益在尾部事件中失效,这就是波动率微笑存在的原因 > 无股息假设让我在除息日吃了亏,我的代码未对此进行调整 > 无摩擦市场是个笑话,我的实际成交价比中间价差了 5-10%

how i actually trade with it now:

我现在实际的交易方式:

i stopped using Black-Scholes to price options, i use it to read the market

我不再用 Black-Scholes 来给期权定价,而是用它来解读市场

the gap between my model price and the market price is implied vol vs my assumption, that's INFORMATION, not a mispricing to fade

我的模型价格与市场价格的差距,代表了隐含波动率与我假设之间的差异,这是信息,而非可以反向交易的错误定价

example: model says $2.85 using 14% vol, market says $3.40, market is implying 22% on that strike then i decide with vega:

示例:使用 14% 的波动率,模型定价为 $2.85,而市场报价为 $3.40,这意味着该行权价隐含了 22% 的波动率 然后我根据 vega 做出决策:

> if 22% looks too high going into an event, i short vega through a spread > if 22% still looks cheap, i buy vega > i never trade the gap as a pure mispricing

> 如果进入某个事件前,22% 看起来过高,我就通过价差策略做空 vega > 如果 22% 看起来仍然便宜,我就做多 vega > 我从不将这种价差视为纯粹的定价错误进行交易

the Greeks are what i actually check before every trade:

我在每笔交易前实际检查的希腊字母:

> delta: my directional exposure across the book > gamma: how fast delta changes on big moves, i size smaller when gamma is high > theta: daily cost or income from time decay > vega: my volatility exposure, i cut this before earnings and Fed meetings

> delta:我在整个持仓中的方向性敞口 > gamma:在大波动中 delta 的变化速度,当 gamma 较高时我会缩小仓位规模 > theta:时间衰减带来的每日成本或收益 > vega:我的波动率敞口,我在财报发布和美联储会议前会削减这部分敞口

the honest breakdown:

诚实的剖析:

Black-Scholes is not a trading model, it's a FRAMEWORK for understanding options

Black-Scholes 不是一个交易模型,而是一个理解期权的框架

the formula prices options for a market that doesn't exist, no jumps, no vol changes, no dividends, no slippage

该公式为一个不存在的市场给期权定价:没有跳跃、没有波动率变化、没有股息、没有滑点

but the intuition it gives you about Greeks is priceless

但它赋予你的关于希腊字母的直觉是无价的

build it once from SCRATCH in Python, price a few real options against the market, then watch it break on your first real trade

从零开始在 Python 中构建它,用几个真实期权与市场报价进行对比,然后看着它在你的第一笔真实交易中崩溃

that's how you actually learn options

这才是你真正学习期权的方式

for serious pricing you eventually move to Heston, but that's a rabbit hole for another post

对于严肃的定价,你最终会转向 Heston 模型,但这又是另一篇帖子要讲的深坑话题

use Black-Scholes for the Greeks, read the price gap as implied vol, trade with vega instead of against the model

用 Black-Scholes 处理希腊字母,将价格差解读为隐含波动率,基于 vega 进行交易,而不是与模型对抗

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件