Option Pricing: Replicating ThinkOrSwim’s Greeks & Theo Price in Python to limited success…

20 hours ago 2
ARTICLE AD BOX

Help: Replicating TOS Greeks & Theo Price in Python to limited success….

Hi, I'm trying to replicate ThinkOrSwim's theoretical option price and greeks (in their risk analysis tab, shown here: image) in Python and hitting a consistent gap I can't explain. Posting the code here: https://pastebin.com/Fg63WhCr

import schwabdev client = Schwabdev.client(…)

I forgot to mention in the code, I use schwabdev client to fetch option and market price, but yfinance or anything can be used. I tried schwabdev hoping for way to fetch this Theo price but nope.

I'm analyzing a long-dated American put: NVDA $180 Put expiring 2028-12-15. I'm using Black-Scholes-Merton (py\\\_vollib) for greeks and theo price. I also tried a binomial tree for pricing but that made the gap worse. I tried leap call too for AAPL and similar issue of it being valued $5-30 less than TOS.

INPUTS (matched as closely as possible to TOS):

S = 190.00 (last price from Schwab API)

K = 180.00

r = 0.0375

q = 0.0046 (TOS reports 'Yield' as 0.46% for this specific contract)

sigma/Vol = 0.4817 (solved via binomial tree IV from market mark price — TOS reports 48.50% but manually setting it to 0.4850 didn't help much)

flag = 'p' for put

MY OUTPUT vs TOS ACTUAL (Theo per contract, 0% slice / today):

DTE | My Theo | TOS Theo | Delta

1027 | $4290.28 | $4313.40 | -$23

827 | $3941.66 | $3970.05 | -$28

427 | $2934.31 | $2969.15 | -$35

127 | $1528.31 | $1566.29 | -$38

12 | $ 258.51 | $ 309.62 | -$51

Gap grows as the as of date gets closer to expiration date, suggesting it's not just a flat input offset.

Greeks are generally close but theta and gamma diverge more near expiration.

\\---

QUESTIONS:

1. ⁠Is BSM simply the wrong model for American puts and should I use Bjerksund-Stensland or a binomial tree instead? (I tried binomial for pricing and the gap got worse, not better.) if so, how? Are the parameters I have here the right ones for those models too or also incorrect?

2. What exact pricing model and interest rate convention does TOS use? Is it documented anywhere? Is it smth complex like TOS using their own volatility surface or other unavailable proprietary data, or just some plain coding error? Or something else?

⁠3. Is there a known way to replicate TOS theo prices in Python to within a few dollars per contract? I tried SchwabDev and

Any help would be massively appreciated. Happy to share more data points.

Thanks

Read Entire Article