WRDS Macros: Option Pricing Models

Binomial Option Pricing Model for American Options

Example

/* ********************************************************************************* */
/* ************** W R D S   R E S E A R C H   A P P L I C A T I O N S ************** */
/* ********************************************************************************* */
/* Summary: Binomial Option Pricing Model for American Options                       */
/* Author : Rabih Moussawi, WRDS                                                     */
/* Date   : January 2006                                                             */
/* ********************************************************************************* */

/* Macro to Calculate the Intrinsic Option Value at Each Node */
%macro val(si,xi);
  (&si-&xi+abs(&si-&xi))/2
%mend val;

/* Macro to Calculate the Option Price at Each Node           */
%macro c(ni,ss);
  %if &ni=&n %then
   %do;
      %val (&ss,&x)
   %end;
      %else %do;
          max(%val(&ss,&x),((%c(&ni+1,&ss*&u))*&p+(%c(&ni+1,&ss*&d))*(1-&p))/&rq)
      %end;
%mend c;


/* Set the Option Variables and Call the Macros               */
data b;
  %let s=7986;  /* underlying security price                  */
  %let x=8000;  /* strike price                               */
  %let n=7;     /* nt = n = number of subperiods              */
  %let t=.18;   /* time to maturity, in years                 */
  %let h=&t/&n; /* it=h=T/n= size of the sub-period           */
  %let r=.0293; /* r = continuously compounded risk free rate */
  %let q=0.0254;/* dividend yield                             */
  %let sig=0.24;/*implied Volatility                          */

  %let u =exp(&sig*sqrt(&h));
  %let d =exp(-&sig*sqrt(&h));
  %let rq=exp((&r-&q)*&h);
  %let p =(&rq-&d)/(&u-&d);

  c=%c(0,&s);
  output;
run;

/* ********************************************************************************* */
/* *************  Material Copyright Wharton Research Data Services  *************** */
/* ****************************** All Rights Reserved ****************************** */
/* ********************************************************************************* */

Top of Section

Top