Calculate the price of a Binary (Digital) Option using the Black-Scholes framework.

A binary option pays out a fixed amount if the option expires in-the-money and nothing otherwise. Two variants are supported through the option_type parameter: “cash-or-nothing” (the default) pays a fixed cash amount and “asset-or-nothing” pays the value of the underlying asset if the option expires in-the-money.

The formula is as follows:

\[d_{1} = (\ln(S / K) + (r - q + \sigma ^{2} / 2) \cdot t) / (\sigma \cdot \sqrt{t})\] \[d_{2} = d_{1} - \sigma \cdot \sqrt{t}\] \[\text{Cash-or-Nothing Call} = \text{Cash Payout} \cdot e ^{- r \cdot t} \cdot N(d_{2}),\;\; \text{with Cash Payout defaulting to 1}\] \[\text{Cash-or-Nothing Put} = \text{Cash Payout} \cdot e ^{- r \cdot t} \cdot N(- d_{2})\] \[\text{Asset-or-Nothing Call} = S \cdot e ^{- q \cdot t} \cdot N(d_{1})\] \[\text{Asset-or-Nothing Put} = S \cdot e ^{- q \cdot t} \cdot N(- d_{1})\]

Where S is the stock price (the traded close on the pricing date), K is the strike price, r is the continuously compounded risk-free rate, q is the continuous dividend yield (ln(1 + dividend yield)), σ is the annualized volatility (the standard deviation of the daily returns over the trailing 252 trading days times √252), t is the time to expiration in years (days / 365) and N is the cumulative standard normal distribution.

Also known as: digital option, all-or-nothing option, cash-or-nothing option, asset-or-nothing option.

Binary Option in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_binary_option as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["GOOGL"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

binary_option = toolkit.options.get_binary_option(
    strike_price_range=0.1, strike_step_size=5, expiration_time_range=91
)

binary_option.loc["GOOGL", ["2026-01-30", "2026-03-01", "2026-03-31"]]

Or, after setting up the Finance Toolkit MCP, ask:

What was a cash-or-nothing call on Alphabet paying $1 worth at the end of 2025 for the expiries of 30 January, 1 March and 31 March 2026, for strikes within 10% of the share price in $5 steps?

Which returns:

Strike Price 2026-01-30 2026-03-01 2026-03-31
280 0.8793 0.7914 0.7413
285 0.8376 0.7516 0.7053
290 0.7881 0.7086 0.6678
295 0.7315 0.6631 0.6291
300 0.6693 0.6157 0.5896
305 0.6029 0.5674 0.5498
310 0.5345 0.5187 0.5101
315 0.4662 0.4705 0.4709
320 0.3998 0.4234 0.4325
325 0.3371 0.3781 0.3952
330 0.2795 0.335 0.3595
335 0.2278 0.2945 0.3254
340 0.1827 0.257 0.2931

Parameters

get_binary_option accepts the following parameters.

ParameterTypeDescriptionExample
start_datestr | NoneThe date whose price, volatility and rates the values start from; a date without prices (a weekend or a holiday) uses the last trading day before it, and a ticker without a price on that day is left out with a warning. Defaults to None, which uses the last date of the historical data."2021-01-01"
put_optionboolWhether to calculate the put option price. Defaults to False which means it will calculate the call option price.True
option_typestrEither “cash-or-nothing” or “asset-or-nothing”. Defaults to “cash-or-nothing”."asset-or-nothing"
cash_payoutfloatThe fixed cash amount paid out by a cash-or-nothing option when it expires in-the-money. Ignored for asset-or-nothing options. Defaults to 1.0.10.0
strike_price_rangefloatThe percentage range to use for the strike prices. Defaults to 0.25 which equals 25% and thus results in strike prices from 75 to 125 if the current stock price is 100.0.1
strike_step_sizeintThe step size to use for the strike prices. Defaults to 5 which means that the strike prices will be 75, 80, 85, 90, 95, 100, 105, 110, 115 and 120 if the current stock price is 100.1
expiration_time_rangeintThe number of days to use for the time to expiration: the columns are the expirations 1 up to expiration_time_range - 1 days after the start date. Defaults to 30, which gives expirations of 1 to 29 days.90
risk_free_ratefloatThe risk free rate to use for the calculation. Defaults to None, which uses the Toolkit’s risk-free rate on the pricing date: the 10-year Treasury yield unless the Toolkit’s risk_free_rate parameter selects ‘13w’, ‘5y’ or ‘30y’, converted from its semi-annual bond-equivalent quote to continuous compounding. A rate passed here is used as given, as a continuously compounded rate.0.04
dividend_yieldfloatThe dividend yield to use for the calculation. Defaults to None, which uses the dividend yield on the pricing date (the dividends of the 365 days up to it relative to its close, as the continuously compounded ln(1 + q)). A given value is used as a continuous yield.0.02
show_input_infoboolWhether to show the input information. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
standardizeboolWhether to standardize (Z-Score) the result across the time to expiration columns for each ticker and strike price. Defaults to False.True
Share