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

📄 tst_finite_diff.cc

📁 Financial Recipes
💻 CC
字号:
// tst_finite_diff.ccvoid test_finite_diff(){    cout << "Testing finite differences " << endl;    double S = 50.0;    double X = 50.0;    double r = 0.1;     double sigma = 0.4;    double time=0.4167;    int no_S_steps=20;    int no_t_steps=11;    cout << " black scholes call price = " 	 << option_price_call_black_scholes(S,X,r,sigma,time)	 << endl;    cout << " explicit FD American call price = ";    cout << option_price_call_american_finite_diff_explicit(S,X,r,sigma,time,no_S_steps,no_t_steps) 	 << endl;    cout << " black scholes put price = " 	 << option_price_put_black_scholes(S,X,r,sigma,time)	 << endl;    cout << " explicit Euro put price = ";    cout << option_price_put_european_finite_diff_explicit(S,X,r,sigma,time,no_S_steps,no_t_steps) 	 << endl;    cout << " explicit American put price = ";    cout << option_price_put_american_finite_diff_explicit(S,X,r,sigma,time,no_S_steps,no_t_steps) 	 << endl;    cout << " done finite differences " << endl;};

⌨️ 快捷键说明

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