FinancialToolbox.blkimpv
— FunctionBlack Implied Volatility for European Options
σ=blkimpv(F0,K,r,T,Price,FlagIsCall=true,xtol=1e-14,ytol=1e-15)
Where:
F0 = Value of the Forward.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
Price = Price of the Option.
FlagIsCall = true for Call Options, false for Put Options.
σ = implied volatility of the European Option.
Example
julia> blkimpv(10.0,10.0,0.01,2.0,2.0)
0.36568658096623635
FinancialToolbox.blkprice
— FunctionBlack Price for European Options
Price=blkprice(F0,K,r,T,σ,FlagIsCall=true)
Where:
F0 = Value of the Forward.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility.
FlagIsCall = true for Call Options, false for Put Options.
Price = price of the European Option.
Example
julia> blkprice(10.0,10.0,0.01,2.0,0.2)
1.1023600107733191
FinancialToolbox.blsbin
— FunctionBlack Price for Binary European Options
Price=blsbin(S0,K,r,T,σ,FlagIsCall=true)
Where:
F0 = Value of the Forward.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility.
FlagIsCall = true for Call Options, false for Put Options.
Price = price of the Binary European Option.
Example
julia> blsbin(10.0,10.0,0.01,2.0,0.2)
0.4624714677292208
FinancialToolbox.blsdelta
— FunctionBlack & Scholes Delta for European Options
Δ=blsdelta(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Δ = delta of the European Option.
Example
julia> blsdelta(10.0,10.0,0.01,2.0,0.2,0.01)
0.5452173371920436
FinancialToolbox.blsgamma
— FunctionBlack & Scholes Gamma for European Options
Γ=blsgamma(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Γ = gamma of the European Option.
Example
julia> blsgamma(10.0,10.0,0.01,2.0,0.2,0.01)
0.13687881535712826
FinancialToolbox.blsimpv
— FunctionBlack & Scholes Implied Volatility for European Options
σ=blsimpv(S0,K,r,T,Price,d=0.0,FlagIsCall=true,xtol=1e-14,ytol=1e-15)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
Price = Price of the Option.
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
σ = implied volatility of the European Option.
Example
julia> blsimpv(10.0,10.0,0.01,2.0,2.0)
0.3433730534290586
FinancialToolbox.blslambda
— FunctionBlack & Scholes Lambda for European Options
Λ=blslambda(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Λ = lambda of the European Option.
Example
julia> blslambda(10.0,10.0,0.01,2.0,0.2,0.01)
4.945909973725978
FinancialToolbox.blsprice
— FunctionBlack & Scholes Price for European Options
Price=blsprice(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Price = price of the European Option.
Example
julia> blsprice(10.0,10.0,0.01,2.0,0.2,0.01)
1.1023600107733191
FinancialToolbox.blspsi
— FunctionBlack & Scholes Psi for European Options
Ψ=blspsi(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Ψ = psi of the European Option.
Example
julia> blspsi(10.0,10.0,0.01,2.0,0.2,0.01)
-10.904346743840872
FinancialToolbox.blsrho
— FunctionBlack & Scholes Rho for European Options
ρ=blsrho(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
ρ = rho of the European Option.
Example
julia> blsrho(10.0,10.0,0.01,2.0,0.2,0.01)
8.699626722294234
FinancialToolbox.blstheta
— FunctionBlack & Scholes Theta for European Options
Θ=blstheta(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Θ = theta of the European Option.
Example
julia> blstheta(10.0,10.0,0.01,2.0,0.2,0.01)
-0.26273403060652334
FinancialToolbox.blsvanna
— FunctionBlack & Scholes Vanna for European Options
Vanna=blsvanna(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
Vanna = vanna of the European Option.
Example
julia> blsvanna(10.0,10.0,0.01,2.0,0.2,0.01)
0.2737576307142566
FinancialToolbox.blsvega
— FunctionBlack & Scholes Vega for European Options
ν=blsvega(S0,K,r,T,σ,d=0.0,FlagIsCall=true)
Where:
S0 = Value of the Underlying.
K = Strike Price of the Option.
r = Zero Rate.
T = Time to Maturity of the Option.
σ = Implied Volatility
d = Implied Dividend of the Underlying.
FlagIsCall = true for Call Options, false for Put Options.
ν = vega of the European Option.
Example
julia> blsvega(10.0,10.0,0.01,2.0,0.2,0.01)
5.475152614285131
FinancialToolbox.daysact
— MethodActual Number of days between two dates
ndays=daysact(Date1,Date2)
Where:
Date1 = Start date.
Date2 = End date.
ndays = Actual Number of days between Start Date and End Date.
Example
julia> daysact(Date(1996,10,12),Date(1998,1,10))
455
FinancialToolbox.fromExcelNumberToDate
— MethodFrom Excel Number Format to Date
Date=fromExcelNumberToDate(ExcelNumber)
Where:
ExcelNumber = Integer representing a date in the excel format.
Date = Date representing the input in the Julia object format.
Example
julia> fromExcelNumberToDate(45000)
2023-03-15
FinancialToolbox.normcdf
— MethodCumulative Distribution Function of a Standard Gaussian Random Variable
y=normcdf(x)
Where:
x = point of evaluation.
y = probability that a standard gaussian random variable is below x.
Example
julia> normcdf(0.0)
0.5
FinancialToolbox.normpdf
— MethodProbability Distribution Function of a Standard Gaussian Random Variable
y=normpdf(x)
Where:
x = point of evaluation.
y = value.
Example
julia> normpdf(0.0)
0.3989422804014327
FinancialToolbox.yearfrac
— MethodFraction of year between two Dates according the following convention
yfr=yearfrac(Date1,Date2,basis)
Where:
Date1 = Start date.
Date2 = End date.
basis = Integer representing the following conventions:
- 0 = (ACT/ACT)
- 1 = (30/360 SIA)
- 2 = (ACT/360)
- 3 = (ACT/365)
- 4 = (30/360 PSA)
- 5 = (30/360 ISDA)
- 6 = (30E/360)
- 7 = (ACT/365 JPN)
yfr = fraction of year between start and end date according to basis.
Example
julia> yearfrac(Date(1996,10,12),Date(1998,1,10),1)
1.2444444444444445