Main Content


Price vanilla options on stocks using standard trinomial tree



[Price,PriceTree] = optstockbystt(STTTree,OptSpec,Strike,Settle,ExerciseDates) returns vanilla option (American, European, or Bermudan) prices on stocks using a standard trinomial (STT) tree.


[Price,PriceTree] = optstockbystt(___,Name,Value) adds optional name-value pair arguments.


collapse all

Create a RateSpec.

StartDates = 'Jan-1-2009'; 
EndDates = 'Jan-1-2013'; 
Rates = 0.035; 
Basis = 1; 
Compounding = -1;
RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,...
'EndDates', EndDates, 'Rates', Rates,'Compounding', Compounding, 'Basis', Basis)
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: -1
             Disc: 0.8694
            Rates: 0.0350
         EndTimes: 4
       StartTimes: 0
         EndDates: 735235
       StartDates: 733774
    ValuationDate: 733774
            Basis: 1
     EndMonthRule: 1

Create a StockSpec.

AssetPrice = 85; 
Sigma = 0.15; 
StockSpec = stockspec(Sigma, AssetPrice)
StockSpec = struct with fields:
             FinObj: 'StockSpec'
              Sigma: 0.1500
         AssetPrice: 85
       DividendType: []
    DividendAmounts: 0
    ExDividendDates: []

Create an STTTree.

NumPeriods = 4;
TimeSpec = stttimespec(StartDates, EndDates, 4);
STTTree = stttree(StockSpec, RateSpec, TimeSpec)
STTTree = struct with fields:
       FinObj: 'STStockTree'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [0 1 2 3 4]
         dObs: [733774 734139 734504 734869 735235]
        STree: {1x5 cell}
        Probs: {[3x1 double]  [3x3 double]  [3x5 double]  [3x7 double]}

Define the call and put options and compute the price.

Settle = '1/1/09';
ExerciseDates = [datenum('1/1/11');datenum('1/1/12')];
OptSpec =  {'call';'put'};
Strike =[100;80];

Price = optstockbystt(STTTree, OptSpec, Strike, Settle, ExerciseDates)
Price = 2×1


Input Arguments

collapse all

Stock tree structure for a standard trinomial tree, specified by using stttree.

Data Types: struct

Definition of option, specified as 'call' or 'put' using a character vector.

Data Types: char | cell

Option strike price value, specified with a NINST-by-1 or NINST-by-NSTRIKES depending on the option type:

  • For a European option, use a NINST-by-1 vector of strike prices.

  • For a Bermuda option, use aNINST-by-NSTRIKES matrix of strike prices. Each row is the schedule for one option. If an option has fewer than NSTRIKES exercise opportunities, the end of the row is padded with NaNs.

  • For an American option, use a NINST-by-1 of strike prices.

Data Types: double

Settlement date or trade date for the vanilla option, specified as a NINST-by-1 vector of date character vectors or serial date numbers.


The Settle date for every vanilla option is set to the ValuationDate of the stock tree. The vanilla option argument Settle is ignored.

Data Types: char | double

Option exercise dates, specified as a NINST-by-1,NINST-by-2, or NINST-by-NSTRIKES using serial date numbers or date character vectors, depending on the option type:

  • For a European option, use a NINST-by-1 vector of dates. Each row is the schedule for one option. For a European option, there is only one ExerciseDates on the option expiry date.

  • For a Bermuda option, use a NINST-by-NSTRIKES vector of dates. Each row is the schedule for one option.

  • For an American option, use a NINST-by-2 vector of exercise date boundaries. The option can be exercised on any date between or including the pair of dates on that row. If only one non-NaN date is listed, or if ExerciseDates is a NINST-by-1 vector, the option can be exercised between ValuationDate of the stock tree and the single listed ExerciseDates.

Data Types: double | char

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: Price = optstockbystt(RateSpec,StockSpec,OptSpec,Strike,Settle,ExerciseDates,'AmericanOpt','1')

Option type, specified as the comma-separated pair consisting of 'AmericanOpt' and a NINST-by-1 vector of integer flags with values:

  • 0 — European or Bermuda

  • 1 — American

Data Types: single | double

Output Arguments

collapse all

Expected price of the vanilla option at time 0, returned as a NINST-by-1 vector.

Structure containing trees of vectors of instrument prices and accrued interest, and a vector of observation times for each node. Values are:

  • PriceTree.PTree contains the clean prices.

  • PriceTree.tObs contains the observation times.

  • PriceTree.dObs contains the observation dates.

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)


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 R2015b