Results 1 to 1 of 1

Option Valuation

Threaded View

tshah1992 Option Valuation 01-16-2017, 12:54 AM
  1. #1
    Registered User
    Join Date
    01-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    1

    Question Option Valuation

    Hi,

    I am trying to build binomial option model in excel. right now I have a macro in place that values American put model & also construct a binomial tree upto 200 nodes. I am trying to make it more dynamic by making it value american call as well as europian options.

    I have formulas but I am not able to make my macro run. To give a proper view first I will post the formulas to value bith american & europian options. Below that I will write the macro I am using. Please have a look and help me out if you can.


    Function Max(A, B)
    If A > B Then Max = A Else Max = B
    End Function
    
    Function option_price(A, B, C, K, P, rate, T, N)
    option_price = Max((P * A + (1 - P) * B) * Exp(-rate * T / N), K - C)
    End Function
    
    Sub Macro1()
    N = Cells(3, 2).Value
    Striking_Price = Cells(8, 2).Value
    Volatility = Cells(6, 2).Value
    Current_Stock = Cells(7, 2).Value
    r = Cells(5, 2).Value
    Maturity = Cells(4, 2).Value
    U = Exp(Volatility * (Maturity / N) ^ (0.5))
    D = 1 / U
    P = (Exp(r * (Maturity / N)) - D) / (U - D)
    Flag = True
    Counter = 11
    
    Cells(3, 5).Value = U
    Cells(4, 5).Value = D
    Cells(5, 5) = P
    
    Do While (Flag = True)
    Counter = Counter + 1
    If Cells(Counter, 1).Value <> Empty Then Flag = False
    Loop
    
    For i = 10 To (Counter - 11) + Counter + 1
    For j = 1 To (Counter - 11) / 2 + 1
    Cells(i, j).Select
    Selection.Clear
    Next
    Next
    
    For i = 0 To N
    Cells(10, N + 1).Value = N
    Cells(11 + i * 4, N + 1).Value = Current_Stock * (U ^ (N - i)) * (D ^ i)
    Cells(11 + i * 4, N + 1).Interior.ColorIndex = 6
    Cells(11 + i * 4 + 1, N + 1).Value = Max(Striking_Price - Current_Stock * (U ^ (N - i)) * (D ^ i), 0)
    Cells(11 + i * 4 + 1, N + 1).Interior.ColorIndex = 12
    Next
    
    For j = 1 To N
    For i = 0 To N - j
    Cells(10, N - j + 1).Value = N - j
    Cells(11 + 2 * j + i * 4, N - j + 1).Value = Current_Stock * (U ^ (N - j - i)) * (D ^ i)
    Cells(11 + 2 * j + i * 4, N - j + 1).Interior.ColorIndex = 6
    Cells(11 + 2 * j + i * 4 + 1, N - j + 1).Value = option_price(Cells(11 + 2 * j + i * 4 + 1 - 2, N - j + 2), Cells(11 + 2 * j + i * 4 + 1 + 2, N - j + 2), Cells(11 + 2 * j + i * 4, N - j + 1), Striking_Price, P, r, Maturity, N)
    Cells(11 + 2 * j + i * 4 + 1, N - j + 1).Interior.ColorIndex = 12
    Next
    Next
    
    Cells(6, 5).Value = Cells(11 + 2 * N + 1, 1).Value
    Cells(6, 5).NumberFormat = "0.000"
    Range("B3:B8").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Cells(6, 5).Select
    MsgBox "The price is " & Format(Cells(6, 5).Value, "0.000") & ".", vbInformation, "American Put"
    End Sub
    Edit1: As per forum policy, I have also asked this question on other forum. The link to the same is as below.
    http://www.mrexcel.com/forum/excel-q...valuation.html
    Last edited by tshah1992; 01-16-2017 at 03:28 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What-if analysis on DCF valuation
    By drakaz in forum Excel General
    Replies: 0
    Last Post: 03-04-2014, 02:15 PM
  2. valuation of inventory with their sale value
    By mahaveersomani in forum Excel General
    Replies: 1
    Last Post: 02-19-2013, 04:38 AM
  3. First-In First-Out (FIFO) Valuation
    By gentle_20052006 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2011, 01:20 PM
  4. stock valuation help
    By Benoj in forum Excel General
    Replies: 3
    Last Post: 11-15-2010, 04:45 PM
  5. Inventory Valuation
    By aromaveda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2009, 03:39 AM
  6. Inventory Valuation
    By aromaveda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2009, 02:56 PM
  7. Portfolio valuation over time
    By Old Red One in forum Excel General
    Replies: 0
    Last Post: 02-20-2006, 06:45 PM
  8. Inventory Valuation
    By aromaveda in forum ExcelTip.com Feedback / Comments / Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1