This was an old project of mine. The idea: Model the option prices as a Wiener process and offer better prices than the straight arbitrage by using the reflection theorem (and making use of the underlying's volatility). With this, I modelled the likelihood of stock prices reaching exercise thresholds during an option's lifetime. See below!
The core idea is to exploit potential mispricings in deep ITM options by:
- Monitoring real-time stock and option data streams
- Identifying put options where the bid price is below intrinsic value:
$o_{bp} < o_{strike} - s_{ap}$ (or for calls:$o_{bp} < s_{bp} - o_{strike}$ ) - Buying such an option and simultaneously trading the underlying stock to lock in a profit
This repository develops the mathematical framework to determine the maximum option bid price (
We listen to the stock and option data streams and filter for option quotes priced below their intrinsic value. When the option bid price (
Figure 1: Option premiums (bid and ask for puts and calls) vs strike price. Pink stars indicate placed bids. Dashed lines show the intrinsic value boundaries y = x - S0 and y = -x + S0 where S0 = 17.02.
Rather than waiting for exact arbitrage (which will never happen nowadays), we develop a probabilistic model to determine a fair bid price for the option — the maximum we can pay while still expecting a profit in the long run if we assume it to behave purely like a Wiener process (random motion) with historical volatility (big assumption).
We model the stock price as a random walk (Brownian motion) with variance that scales linearly with time. The historical volatility of the underlying stock over the last
The standard Black-Scholes parameters are:
For European options, we only need the probability of the stock being below a threshold at maturity
This is calculated using the reflection principle of a Wiener process. The key insight is: after the stock reaches any threshold, its expected move is zero (symmetric random walk), so it is equally likely to end above or below that threshold at maturity. Therefore, the probability of ever reaching a threshold is exactly twice the probability of being beyond it at expiry:
where
Figure 2: Probability of the stock price falling below a threshold. Blue: at maturity t = T only. Orange: at any point during [0, T] (reflection principle). Example with S0 = 17, 2 days to expiration.
Given a put option with strike
By mapping the threshold probabilities to the corresponding PnL values, we construct:
- CDF of PnL: the cumulative distribution of payoffs for different option bid prices
- PDF of PnL: the derivative of the CDF, giving the probability density of each payoff level
The integral of the PDF indicates whether a given
- Integral
$= 1.0$ : the option is underpriced (expected profit) - Integral
$< 0$ : the option is overpriced (expected loss)
A risk-neutral option price is achieved when the expected PnL equals zero. Importantly, this does not mean 50% of trades are profitable — it means the expected dollar return is zero.
Figure 3: PnL analysis for different option bid prices (obp). Top-left: Probability of reaching threshold (CDF). Top-right: PDF of PnL — integral = 1.00 for fairly-priced options, negative for overpriced. Bottom-left: CDF of PnL (payoff curves). Bottom-right: The risk-neutral bid price is obp = $1.81, with a profitability threshold of $16.69 and 52.33% probability of profit.
The expected PnL for a given option bid price
where:
-
$P_{\text{cum},T}$ = probability of the stock reaching threshold$T$ at any point during the option's lifetime - First term: payoff if the stock never reaches the threshold (exercise at
$S_0$ or let the option expire) - Second term: payoff if the stock does reach threshold
$T$ (buy stock at$T$ , exercise put at strike$K$ )
By evaluating the expected PnL across all combinations of stock buying thresholds and option bid prices, we construct a heatmap:
Figure 4: Expected PnL as a function of stock buying threshold (x-axis) and option bid price obp (y-axis). Green = positive expected PnL, red = negative. The black contour marks PnL = 0. The blue line traces the optimal threshold (maximum PnL) for each obp.
Key results for the example (
| Metric | Value |
|---|---|
| Maximum PnL threshold | T = $16.64 |
| Limiting bid price | o_bp = $1.67 |
| Probability of being profitable | 52.33% |
The limiting bid price of $$1.67$ is the highest option price that still yields non-negative expected PnL. Any option purchased below this price is expected to be profitable in the long run. Note, how this is more competitive than the $$1.50$ straight arbitrage price! A fun way to develop this mathematically.
pip install numpy scipy matplotlib
Both scripts accept CLI parameters and default to the example values used throughout this writeup (
# Compute PnL distribution across different option bid prices
python option_bid_price_model_retrospective_bids.py
# Find optimal stock buying threshold for each bid price (heatmap)
python option_bid_price_model_with_optimal_thresholds.py| Parameter | Description | Default |
|---|---|---|
--stock-price |
Current stock price |
17 |
--strike |
Put option strike price | 18.5 |
--days |
Days to expiration | 2 |
--volatility |
Daily volatility as fraction of stock price | 0.02 |
--save PATH |
Save figure to file instead of displaying | (show) |
# Custom scenario: $50 stock, $55 strike, 5 days, 3% daily volatility
python option_bid_price_model_with_optimal_thresholds.py \
--stock-price 50 --strike 55 --days 5 --volatility 0.03
# Save output to file
python option_bid_price_model_retrospective_bids.py --save figures/output.png



