A Simple Example of Delta Hedging

download notebookDownload this example as a Mathematica notebook.

Creating Mathematica Functions: The Black-Scholes Model

To demonstrate Mathematica's practical application in financial modeling, we turn to Benninga and Wiener's exploration of a simple delta hedging problem. As a preliminary step, the well-known Black-Scholes theoretical price function for a vanilla European call is defined. The code for this formula, and many others, is available in the Mathematica Information Center or for purchase in application packages such as Derivatives Expert.




Now, to take an example from Hull (2000), we can find the price for writing a European call option on 100,000 shares, given the following parameters:

        Current stock price[Graphics:Images/index_gr_4.gif]
        Strike price[Graphics:Images/index_gr_5.gif]
        Stock volatility[Graphics:Images/index_gr_6.gif]
        Option time to maturity[Graphics:Images/index_gr_7.gif]
        Market rate of interest[Graphics:Images/index_gr_8.gif]


Symbolic Calculus with Mathematica: Deriving the Delta Function

To create a delta hedge, [Graphics:Images/index_gr_11.gif] shares of the underlying stock are purchased, where C is the call price. As a first pass, a static, one-time hedge is considered. Here, Mathematica's symbolic calculus capabilities are used to derive the complicated definition of the delta function; then numeric parameters are fed into this new equation to find the specific hedging ratio.





So, to properly hedge this call, 52,160 shares of the underlying stock are bought at a cost of $49 each, for a total of $2,555,840. To finance this purchase, the capital is borrowed at the market rate of interest (which has been defined as 5%).

Mathematica as a Calculator: Analyzing the Results with Numbers

Now, suppose, after one week the underlying stock price rises to $49.50. The value of the option position has grown from $240,053 to $258,422. If the writer of this call had not hedged the position with a purchase of the underlying stock, the small price movement would have created a loss of over $18,000.



However, with the hedge, the net outcome for the writer of the call is the following:

net gain = Original price received for the call - price of the call one week later + price received for the underying stock
                  one week later - repayment of principal and interest used to buy the underlying stock
In this case, it turns out to be a profit of $5,229.95.


Mathematica as a Visualization Tool: Analyzing Relationships with Graphics

A unique feature of Mathematica as a programming language is its integrated graphics capabilities. Viewing these relationships graphically, we can definitevely see how marginal changes in the underlying stock price have a mitigated effect on returns, when the position is hedged.


To further this point, we can compare this return (in red) to writing an unhedged, or "naked," call (in black). From this graph, it is clear to see that the hedged call dramatically alters the risk of this individual's position in the market.


From this illustration, it is clear that Mathematica is a useful modeling tool because, in one document, analysts can quickly and easily alternate between symbolic, numeric, and graphic analysis of the same problem. This flexibility can provide a deeper understanding of financial models than any other single system can.

The Next Step: Mathematica as an Extensible, Programmable Application

The purpose of this exercise has been to walk through a simple modeling exercise to better demonstrate the basic design of Mathematica and the "look and feel" of the notebook interface. To extend this discussion, the next step is to look at changing the delta position each week, allowing dynamic management of the risk exposure over the 20-week life span of the call.  This is covered in the full text of Benninga and Wiener's article.

Note: All of the code used in this example was modified from the article "Dynamic Hedging Strategies" by Simon Benninga and Zvi Wiener. The article is a more thorough introduction to this subject and may be downloaded in PDF file format from http://finance.wharton.upenn.edu/~benninga/wiener.html.