Skip to the page

Options

pt-v22 lists options on every company in the roster. They are American, 100 shares a contract, and settle in shares at the expiry session's close. A dealer quotes each one from a tree on the name's implied-volatility surface, which follows the name's own volatility and its earnings calendar.

Each name lists six expiries, from about three weeks to a year out. Strikes sit in a fixed grid around the price: a stock at 197 lists strikes from 145 to 245, 5 dollars apart. The dealer shows 20 contracts at each of ten prices on its bid and its ask. Options list at the first close and are switched on by options_names_listed.

Symbols

AAA.O0035.C195.00 is the 195 call on AAA that expires at the close of session 35: the ticker, O and the expiry session, C or P, and the strike in dollars and cents. As with futures, the library numbers sessions from 0 and the hosted app shows days from 1, so the app calls the same option AAA.O0036.C195.00.

Chains and quotes

import tradefloor as tf

engine = tf.Engine(seed=7, universe=tf.Universe.random(20, seed=11), model="pt-v22")
engine.run_days(1)                     # options list at the first close

name = engine.name_option_roots()[0]
for e in engine.option_expiries(name):
    print(e["expiry"], e["forward"], e["atm_iv"], e["skew_25d"])

nearest = engine.option_expiries(name)[0]["expiry"]
for row in engine.chain(name, nearest)[:4]:
    print(row["symbol"], row["bid"], row["ask"], row["iv"], row["delta"])

option_expiries(ticker) summarizes each listed expiry: the forward, the strike grid (strike_low, strike_high, strike_step), the at-the-money volatility and the 25-delta put and call volatilities with their difference, skew_25d. chain(ticker, expiry) gives one expiry by strike, the call before the put: the dealer's bid and ask with bid_size and ask_size, the mid, the implied volatility iv, delta, gamma, vega, theta, the surface's fair value and surface_iv, the carry, and open_interest. quote(symbol) gives the same for one option with the scan margin one short contract asks. surface(ticker) is the surface itself: iv(k, t) at log moneyness k and t sessions out, the forward(t), and the 30-day volatility index of the name's strip (strip_vix(21)).

Trading and exercise

from tradefloor.portfolio import Portfolio

pf = Portfolio(cash=1_000_000, max_leverage=4.0)
call = next(r["symbol"] for r in engine.chain(name, nearest) if r["right"] == "C")

engine.open_market()
pf.collect_dividends(engine)
pf.settle_open(engine)
pf.execute(engine, call, 5)            # buy 5 contracts from the dealer
pf.exercise(engine, call, 2)           # exercise 2 of them at today's close
engine.run_session(9, 30, 3, 390)
pf.sync(engine)
engine.close_market()
pf.settle_close(engine)                # 200 shares arrive, the strike's cash leaves

print(pf.options, pf.positions[name], pf.deliveries)

An option trades with its dealer, whatever the preset's book settings for stocks. The premium moves cash when the fill happens: contracts times 100 times the price. Portfolio.options holds each position with its average premium, and an option is worth its dealer's mid until it expires.

exercise(engine, symbol, contracts) instructs an exercise at the close, up to the contracts held long, and engine.cancel_exercise withdraws it. An agent does the same from act() by returning tf.Exercise(contracts) for the option's symbol, as in {call: tf.Exercise(2)}. At the close a call receives 100 shares a contract at the strike and a put delivers them. Those shares move without a trade, so they reach Portfolio.deliveries rather than fills, and move no price. The dealer exercises where its tree says to, and its exercises are assigned to short positions in proportion to their size, so an account that is short an option can be handed stock, or go short, without an order. At expiry an option in the money is exercised at the close, and one out of the money closes at nothing. Stock handed over this way is margined from the close it arrives, and an unmet margin call sells it with the options; see Margin.

The hosted app

GET /v1/sessions/{id}/contracts lists each name's expiries, GET /v1/sessions/{id}/contracts/chain?root=AAA&expiry=36&strikes=5 reads one chain, and GET /v1/sessions/{id}/contracts/quotes?symbols=... quotes options by symbol. An option trades with the ordinary order calls in whole contracts, and POST /v1/sessions/{id}/exercise with {"ticker", "contracts"} exercises one held long at today's close. Exercises and assignments appear in the market log as events of kind account. In tfrun, market.chain() reads a chain and exercise(symbol, contracts) is an order.

Measured rows

Each row below was read over the simulated histories the grade uses and is graded against a band read from real market data and fixed before the options were built. Every row falls inside its band.

RowWhat it measurespt-v22Real bandReal value
SS1median 30-day implied volatility over the next 21 sessions' realized volatility1.351.08 to 1.411.25
SS2median 3-month implied correlation from the index and name surfaces, x 10041.634.1 to 47.740.9
SS3median implied less next-63-session realized correlation0.109-0.078 to 0.1850.053
SS4the index's SKEW less a name's, median over names8.57above 0
EV1median log change of a name's 30-day implied volatility across its earnings report-0.151-0.390 to -0.137-0.263
EV2median log change of 30-day implied volatility over the 15 sessions before a report-0.011-0.062 to 0.1640.051
EV3RMS implied earnings move over RMS realized move1.290.72 to 1.311.01

SS1 and EV3 sit near the top of their bands: options on the names are priced a little rich against the volatility that follows, and the implied earnings move a little large against the move that comes. EV1 sits near the top of its band too, so implied volatility falls less across a report than it does in real markets.

The real figures come from Cboe's single-stock volatility indices on Apple, Amazon, Alphabet, Goldman Sachs and IBM with their realized volatility (2011 to 2025), Cboe's 3-month implied correlation index (2006 to 2026) against the realized correlation of 40 large US stocks, those five companies' earnings filings with the SEC for the report dates, and Bakshi, Kapadia and Madan (2003) for the direction of SS4.

Some rows hold by construction, and each was checked:

  • No exercise is off the pricer's boundary, no call is exercised except on the session before an ex-dividend date, and no American price is below the European one (AX1, 0 events).
  • Delivery conserves shares and cash to the cent (AX2, largest error 0.000000004 dollars).
  • Earnings straddles, covered calls, conversions, dividend capture with early exercise and pinning the close at expiry earn nothing beyond their bounds (XD5).