Directory of Open Source for Quantitative Finance and Trading
Username: Password: Not registered?
 
Quick Search:    (AJAX based: No need to press button)

Main : Excel : 


Category: Excel View Full Details
Download Now!Binomial Tree Plotting or display in Excel with multi node values
Submitter: vanna Date: 2009/11/27
Description:
For an example of using this in a spreadsheet, click here

The function DisplayMultiBinomialTree can be used to create a binomial tree display on an excel spreadhsheet.

Parameters are:
treeData - 3 level array with the following levels:
1st level - array of node values (eg., volatility,stock price,etc.)
2nd level - array of above array for a given time
3rd level - array of above arrays
sheetName - name of an existing worksheet to plot the tree

Demo for usage (Here we create a tree with 6 time steps and displaying 4 data at each node):
Public Function GetNodeValues(i, j) As Variant
  ReDim retVal(1 To 4)
  retVal(1) = Rnd()
  retVal(2) = Rnd() * 10
  retVal(3) = Rnd() * 100 + 5
  retVal(4) = Rnd() * 100 + 5
  GetNodeValues = retVal
End Function

Private Sub CommandButton1_Click()
  n = 6  'no of time nodes
  ReDim treeData(1 To n) As Variant
  
  For i = 1 To n 'loop over time axis
    ReDim tmpArr(1 To i) 'array of nodes at each time step
    For j = 1 To i 'loop over each tree node
      tmpArr(j) = GetNodeValues(i, j)
    Next j
    treeData(i) = tmpArr
  Next i
  
  DisplayMultiBinomialTree treeData, "treesheet2"
  
End Sub




Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 1286 times  1286  File Size 0 bytes  Supported Platforms Excel VBA  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (48)

Discuss this file. Just enter your message and click on submit. No registration is required.
Similar Links:
Binomial Tree display in Excel (Software)
Implied Binomial Trees in Excel without VBA (Software)
Binomial trees with R (Software)
Multinomial Lattices and Derivatives Pricing (Paper)
Option Pricing using the Binomial Tree Model in C# (Software)

Subscribe to RSS or daily email updates of latest quantitative finance code listings
Email address :
Copyright © 2011 QuantCode Inc. All rights reserved.