Thanks Again. However, when I test it out on the emulator I have a different problem. I calculate the value and all I get most of the time is either 'infinity' or 'nan'. I have attached the file if anyone would like to take a look.
There is a serious problem with answers not being as they should. Here is the code in Visual Basic if you think it would be of any help:
'// 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
Thank you so much for your help! And don't worry, your English is fine here
There are no different ScrollViews nor is there a best ScrollView. The principle, in all examples, consits in filling a ScrollView with different views dending on what should be displayed.. . . wondering what is the best scrollview to use for this particular app?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?