Main Content

optstockbybls

Price options using Black-Scholes option pricing model

Description

example

Price = optstockbybls(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike) returns option prices using the Black-Scholes option pricing model.

Note

When using StockSpec with optstockbybls, you can modify StockSpec to handle other types of underliers when pricing instruments that use the Black-Scholes model.

When pricing Futures (Black model), enter the following in StockSpec:

DivType = 'Continuous'; 
DivAmount = RateSpec.Rates;
For example, see Compute Option Prices Using the Black-Scholes Option Pricing Model.

When pricing Foreign Currencies (Garman-Kohlhagen model), enter the following in StockSpec:

DivType = 'Continuous'; 
DivAmount = ForeignRate; 

where ForeignRate is the continuously compounded, annualized risk free interest rate in the foreign country. For example, see Compute Option Prices on Foreign Currencies Using the Garman-Kohlhagen Option Pricing Model.

Alternatively, you can use the Vanilla object to price vanilla options. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

Examples

collapse all

This example shows how to compute option prices using the Black-Scholes option pricing model. Consider two European options, a call and a put, with an exercise price of $29 on January 1, 2008. The options expire on May 1, 2008. Assume that the underlying stock for the call option provides a cash dividend of $0.50 on February 15, 2008. The underlying stock for the put option provides a continuous dividend yield of 4.5% per annum. The stocks are trading at $30 and have a volatility of 25% per annum. The annualized continuously compounded risk-free rate is 5% per annum. Using this data, compute the price of the options using the Black-Scholes model.

Strike = 29;
AssetPrice = 30;
Sigma = .25;
Rates = 0.05;
Settle = datetime(2008,1,1);
Maturity = datetime(2008,5,1);

% define the RateSpec and StockSpec
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',...
Maturity, 'Rates', Rates, 'Compounding', -1);

DividendType = {'cash';'continuous'};
DividendAmounts = [0.50; 0.045];
ExDividendDates = {datetime(2008,2,15);NaN};

StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts,...
ExDividendDates);

OptSpec = {'call'; 'put'};

Price = optstockbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike)
Price = 2×1

    2.2030
    1.2025

This example shows how to compute option prices on foreign currencies using the Garman-Kohlhagen option pricing model. Consider a European put option on a currency with an exercise price of $0.50 on October 1, 2015. The option expires on June 1, 2016. Assume that the current exchange rate is $0.52 and has a volatility of 12% per annum. The annualized continuously compounded domestic risk-free rate is 4% per annum and the foreign risk-free rate is 8% per annum. Using this data, compute the price of the option using the Garman-Kohlhagen model.

Settle = datetime(2015,10,1);
Maturity = datetime(2016,6,1);
AssetPrice = 0.52;
Strike = 0.50;
Sigma = .12;
Rates = 0.04;
ForeignRate = 0.08;

Define the RateSpec.

RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',...
Maturity, 'Rates', Rates, 'Compounding', -1)
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: -1
             Disc: 0.9737
            Rates: 0.0400
         EndTimes: 0.6667
       StartTimes: 0
         EndDates: 736482
       StartDates: 736238
    ValuationDate: 736238
            Basis: 0
     EndMonthRule: 1

Define the StockSpec.

DividendType = 'Continuous';
DividendAmounts = ForeignRate;

StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts)
StockSpec = struct with fields:
             FinObj: 'StockSpec'
              Sigma: 0.1200
         AssetPrice: 0.5200
       DividendType: {'continuous'}
    DividendAmounts: 0.0800
    ExDividendDates: []

Price the European put option.

OptSpec = {'put'};
Price = optstockbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike)
Price = 0.0162

Input Arguments

collapse all

Interest-rate term structure (annualized and continuously compounded), specified by the RateSpec obtained from intenvset. For information on the interest-rate specification, see intenvset.

Data Types: struct

Stock specification for the underlying asset. For information on the stock specification, see stockspec.

stockspec handles several types of underlying assets. For example, for physical commodities the price is StockSpec.Asset, the volatility is StockSpec.Sigma, and the convenience yield is StockSpec.DividendAmounts.

Data Types: struct

Settlement or trade date, specified as a NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, optstockbybls also accepts serial date numbers as inputs, but they are not recommended.

Maturity date for option, specified as a NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, optstockbybls also accepts serial date numbers as inputs, but they are not recommended.

Definition of the option as 'call' or 'put', specified as a NINST-by-1 cell array of character vectors with values 'call' or 'put'.

Data Types: char | cell

Option strike price value, specified as a nonnegative NINST-by-1 vector.

Data Types: double

Output Arguments

collapse all

Expected option prices, returned as a NINST-by-1 vector.

Data Types: double

More About

collapse all

Vanilla Option

A vanilla option is a category of options that includes only the most standard components.

A vanilla option has an expiration date and straightforward strike price. American-style options and European-style options are both categorized as vanilla options.

The payoff for a vanilla option is as follows:

  • For a call: max(StK,0)

  • For a put: max(KSt,0)

where:

St is the price of the underlying asset at time t.

K is the strike price.

For more information, see Vanilla Option.

Version History

Introduced in R2008b

expand all