⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 black_scholes_call.cc

📁 Financial Recipes
💻 CC
字号:
#include <cmath>              // mathematical C library#include "normdist.h"         // the calculation of the cumularive normal distributiondouble option_price_call_black_scholes( double S,       // spot (underlying) price					double X,       // strike (exercise) price,					double r,       // interest rate					double sigma,   // volatility 					double time) {  // time to maturity     double time_sqrt = sqrt(time);    double d1 = (log(S/X)+r*time)/(sigma*time_sqrt)+0.5*sigma*time_sqrt;     double d2 = d1-(sigma*time_sqrt);    double c = S * N(d1) - X * exp(-r*time) * N(d2);    return c;};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -