liveBook · Manning

Binomial tree

As explained in Build a Robo-Advisor with Python (From Scratch)

A discrete lattice model that represents possible successive movements in an asset price for valuing derivatives.

A binomial tree prices an American put as an option whose value is evaluated across successive price movements. In the `option-price` package, select the `BT` method when calling `getPrice()` on an American put. section 14.3.2

Set `iteration` to control the tree depth. The option also requires the current asset price, strike price, life in days, annualized volatility, risk-free rate, and dividend yield. A binomial-tree or simulation method uses `iteration` as its computational depth or simulation count. section 14.3.2

Pricing an American put

Create an American put with `s0=150`, `k=140`, `t=30`, `sigma=.45`, `r=.03`, and `dv=.01`, then call `getPrice('BT', iteration=1000)`. This produces a price of about $3.4284. section 14.3.2

from optionprice import Option

x = Option(european=False, kind='put', s0=150, k=140, t=30,
           sigma=.45, r=.03, dv=.01)
p = x.getPrice('BT', iteration=1000)

The listing shows the minimal Python setup for selecting binomial-tree pricing and setting tree depth. section 14.3.2

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Treats binomial trees as a package pricing method and exposes tree depth through iterations, without deriving the lattice mechanics.
Examples
Demonstrates a 30-day American put with a $150 asset price, $140 strike, and 1,000 tree iterations.
What it assumes
Requires supplying option terms, volatility, interest rate, and dividend yield as pricing inputs.
What you can do after
Apply it via the option-price library to price an American put using the BT method.
How it connects
Connects American options with Black–Scholes pricing, Monte Carlo simulations, tax-loss harvesting, and opportunity cost.

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.