Skip to content

bbeckwith-dev/CCsimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Covered Call Simulator

An educational, browser-based simulator for learning how covered call options work. Uses Black-Scholes pricing, geometric Brownian motion for price simulation, and real-time risk gauges to help you understand option mechanics before risking real money.

This is a simulation only. It is not connected to any broker, market data feed, or trading system. It cannot place orders.

Quick Start

  1. Open index.html in any modern browser (Chrome, Edge, Firefox)
  2. Adjust the position parameters on the setup screen (or leave defaults)
  3. Click Sell This Call
  4. Click Play to start the simulation

No install, no dependencies, no build step. Everything runs in a single HTML file.

How It Works

You own 100 shares of a volatile stock (modeled after MSTR). You sell a covered call against those shares to collect premium. The simulator then runs a day-by-day price simulation so you can watch how the position evolves and practice making decisions.

Setup Screen

Field What It Does
Stock Price Current share price
Realized Vol Actual volatility used for price simulation (how much the stock actually moves)
Implied Vol Market-priced volatility used for option pricing (what the market thinks vol will be)
Risk-Free Rate Interest rate assumption for Black-Scholes
Strike Price The price at which your shares could be called away
DTE Days to expiration

The estimated premium updates automatically as you change inputs. The OTM % indicator shows how far out-of-the-money your strike is.

Simulation Controls

  • Play/Pause - Start or stop the day-by-day simulation
  • Speed slider - 1 to 5 days per second
  • Reset - Return to the setup screen

Market Event Buttons

These let you inject sudden market moves to see how your position reacts:

  • BTC Pump +15% - Stock jumps 15% instantly
  • BTC Dump -15% - Stock drops 15% instantly
  • IV Spike +20 - Implied volatility increases (options get more expensive, bad for sellers)
  • IV Crush -20 - Implied volatility decreases (options get cheaper, good for sellers)

Scenarios

Select a preset scenario from the dropdown before selling your call:

Scenario What Happens
Random Normal random price simulation (GBM)
Easy Money Stock stays flat, option expires worthless - you keep full premium
Slow Grind Up Stock drifts toward your strike over the full period
BTC Pump Stock gaps up 25% mid-period, goes deep ITM
Whipsaw Stock spikes up then crashes back down
IV Crush Volatility drops over time, option value collapses quickly
Assignment Day Stock finishes just above your strike at expiration

Reading the Dashboard

Position Summary (left panel) - Shows your current P/L broken down by stock movement and option value.

Risk Gauges (center panel) - Color-coded indicators that warn you when your position needs attention:

  • Green/SAFE - Position is comfortable
  • Yellow/CAUTION - Pay attention, consider adjusting
  • Red/DANGER - Act now or accept significant risk

Key gauges:

  • Delta - How much option price moves per $1 stock move. Above 0.50 = high assignment risk.
  • Distance from Strike - How far the stock is from your strike as a percentage.
  • DTE - Days remaining. Below 7 = gamma risk spikes.
  • Assignment Probability - Estimated chance the option finishes ITM, calculated using N(d2).

Greeks (right panel) - The five option Greeks with tooltip explanations.

Payoff Diagram - Shows your P/L at expiration across a range of stock prices. The yellow dashed line marks the current stock price.

Event Log - Alerts when risk zones change (e.g., delta crosses from safe to caution).

Managing Your Position

When the simulation is running and you want to act, use the action buttons:

Button What It Does
Roll Up Buy back current call, sell a new one at a higher strike (same DTE)
Roll Out Buy back current call, sell a new one with more DTE (same strike)
Roll Up & Out Buy back current call, sell a new one at higher strike AND more DTE
Buy to Close Pay to close your short call, keep your shares
Let It Ride Acknowledge the risk and do nothing

Rolling opens a modal that shows the cost to buy back your current option, the premium from the new option, and the net credit or debit. Rolling for a net debit means you're paying to stay in the trade.

Learning Mode

Toggle Learning Mode on (default) to see inline explanations below each gauge and Greek. Toggle off for a cleaner view once you're comfortable.

What This Teaches

  • Why covered calls cap your upside but provide income
  • How theta decay works in your favor as the seller
  • Why high-volatility stocks are tempting but dangerous for covered calls
  • When and how to roll a position
  • How gamma risk accelerates near expiration
  • The difference between implied and realized volatility
  • Why being "10% OTM" isn't safe on a 90% IV stock

Technical Details

  • Single index.html file, ~1,700 lines
  • Vanilla HTML/CSS/JS, no framework
  • Chart.js 4.x loaded via CDN (only external dependency)
  • Black-Scholes European call pricing with all five Greeks
  • Geometric Brownian Motion (GBM) for price simulation
  • Box-Muller transform for normal random number generation

License

MIT

About

A quick lightweight tool to try and learn some CC and how to guide AI in design work.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages