Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Calculate the price of a European call option using the Black-Scholes formula in F#.
open System
open MathNet.Numerics.Distributions
let blackScholesCall S K r sigma T =
let d1 = (log(S/K) + (r + 0.5 * sigma*sigma) * T) / (sigma * sqrt T)
let d2 = d1 - sigma * sqrt T
S * Normal.CDF(0.0,1.0,d1) - K * exp(-r*T) * Normal.CDF(0.0,1.0,d2)
let callPrice = blackScholesCall 100.0 100.0 0.05 0.2 1.0
printfn "Call Option Price: %f" callPriceF# is a functional-first programming language on the .NET platform, widely used in finance for quantitative modeling, risk analysis, and algorithmic trading due to its strong type system, immutability, and functional programming paradigms.
Origin & Creator
Developed by Microsoft Research in 2005, evolving from OCaml to provide functional-first programming on .NET for both academic and industry applications.
Industrial Note
Extensively used in investment banks, hedge funds, and fintech for quantitative analytics, derivatives pricing, portfolio optimization, and real-time risk management.