LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 114
Default Option Pricing Formula

I have a Black Sholes Option Pricing Model. You can google for this.

You can try this on for size.

Black-Scholes in Visual Basic
By Espen Gaarder Haug
Visual Basic: easy to program but quite slow!


'// The Black and Scholes (1973) Stock option formula:
Public Function BlackScholes(CallPutFlag As String, S As Double, X _
As Double, T As Double, r As Double, v As Double) As Double

Dim d1 As Double, d2 As Double

d1 = (Log(S / X) + (r + v ^ 2 / 2) * T) / (v * Sqr(T))
d2 = d1 - v * Sqr(T)
If CallPutFlag = "c" Then
BlackScholes = S * CND(d1) - X * Exp(-r * T) * CND(d2)
ElseIf CallPutFlag = "p" Then
BlackScholes = X * Exp(-r * T) * CND(-d2) - S * CND(-d1)
End If
End Function

'// The cumulative normal distribution function
Public Function CND(X As Double) As Double

Dim L As Double, K As Double
Const a1 = 0.31938153: Const a2 = -0.356563782: Const a3 = 1.781477937:
Const a4 = -1.821255978: Const a5 = 1.330274429

L = Abs(X)
K = 1 / (1 + 0.2316419 * L)
CND = 1 - 1 / Sqr(2 * Application.Pi()) * Exp(-L ^ 2 / 2) * (a1 * K + a2 * K
^ 2 + a3 * K ^ 3 + a4 * K ^ 4 + a5 * K ^ 5)

If X < 0 Then
CND = 1 - CND
End If
End Function


"rook" wrote:

Does anyone have a pricing formula for stock options?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pricing Jo Excel Discussion (Misc queries) 2 December 16th 06 07:16 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
Old to New Pricing Jennings Excel Worksheet Functions 6 February 12th 06 10:41 PM
spreadsheet for sundries with option for better and best pricing Jahaan Excel Discussion (Misc queries) 1 December 12th 04 04:18 AM
Formula to extract pricing from a chart John F Excel Worksheet Functions 2 November 12th 04 02:04 PM


All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"