http quantlib orgindex shtml 2010126 LOGO Outline v
http: //quantlib. org/index. shtml 碩一 謝昌宏 2010/1/26 LOGO
Outline v. Introduction v. Prepare § Download Quant. Lib, Boost v. Boost Installation v. Boost Configuration v. Quant. Lib Installation v. Demo v. Reference Documentation LOGO
Introduction LOGO v. The Quant. Lib project is aimed at providing a comprehensive software framework for quantitative finance. Quant. Lib is a free/opensource library for modeling, trading, and risk management in real-life. v. Quant. Lib is written in C++ with a clean object model, and is then exported to different languages such as C#, Objective Caml, Java, Perl, Python, GNU R, Ruby, and Scheme.
Prepare – Download Quant. Lib LOGO
Prepare – Download Quant. Lib LOGO
The Base of Quant. Lib - Boost LOGO
Install LOGO
Boost Installation LOGO
Boost Installation LOGO
Boost Installation LOGO
Boost Installation Download boost source code Fit your version of VS LOGO
Boost Installation LOGO
Boost Installation LOGO
Boost Configuration LOGO
Boost Configuration LOGO
Boost Configuration LOGO
Boost Configuration LOGO
Boost Configuration . . boost_140boost LOGO
Quant. Lib Installation Fit your version of VS. Vs 2003 => vc 7. sln Vs 2005 => vc 8. sln Vs 2008 => vc 9. sln LOGO
Quant. Lib Installation Choice mode that you want compile. Note: you can’t use Quant. Lib with some mode that without compile. LOGO
Quant. Lib Installation LOGO
Quant. Lib Installation Result LOGO
Demo - Configuration LOGO
Demo - Configuration LOGO
Demo - Configuration LOGO
Demo - Configuration LOGO
Demo – contents of ql LOGO
Demo – Day Counter v #include "stdafx. h" v v #include <ql/quantlib. hpp> #include <iostream> v v int main(array<System: : String ^> ^args) { Quant. Lib: : Calendar my. Cal=Quant. Lib: : United. Kingdom(); Quant. Lib: : Date new. Years. Eve(31, Quant. Lib: : Dec, 2008); v v v std: : cout << "Name: " << my. Cal. name()<< std: : endl; std: : cout << "New Year is Holiday: " << my. Cal. is. Holiday(new. Years. Eve)<< std: : endl; std: : cout << "New Year is Business Day: " << my. Cal. is. Business. Day(new. Years. Eve)<< std: : endl; v std: : cout << "-------- Date Counter ----------" << std: : endl; v v Quant. Lib: : Date date 1(28, Quant. Lib: : Dec, 2008); Quant. Lib: : Date date 2(04, Quant. Lib: : Jan, 2009); v v v v std: : cout << "First Date: " << date 1 << std: : endl; std: : cout << "Second Date: " << date 2 << std: : endl; std: : cout << "Business Days Betweeen: "<< my. Cal. business. Days. Between(date 1, date 2) << std: : endl; std: : cout << "End of Month 1. Date: " << my. Cal. end. Of. Month(date 1) << std: : endl; std: : cout << "End of Month 2. Date: " << my. Cal. end. Of. Month(date 2) << std: : endl; return 0; } LOGO
Demo – Day Counter LOGO
Demo – Day Counter v #include "stdafx. h" country name ( qltimecalendars ) v v #include <ql/quantlib. hpp> #include <iostream> v v int main(array<System: : String ^> ^args) { Quant. Lib: : Calendar my. Cal=Quant. Lib: : United. Kingdom(); Quant. Lib: : Date new. Years. Eve(31, Quant. Lib: : Dec, 2008); Specific day v v v std: : cout << "Name: " << my. Cal. name()<< std: : endl; std: : cout << "New Year is Holiday: " << my. Cal. is. Holiday(new. Years. Eve)<< std: : endl; std: : cout << "New Year is Business Day: " << my. Cal. is. Business. Day(new. Years. Eve)<< std: : endl; v std: : cout << "-------- Date Counter ----------" << std: : endl; v v Quant. Lib: : Date date 1(28, Quant. Lib: : Dec, 2008); Quant. Lib: : Date date 2(04, Quant. Lib: : Jan, 2009); v v v v std: : cout << "First Date: " << date 1 << std: : endl; std: : cout << "Second Date: " << date 2 << std: : endl; std: : cout << "Business Days Betweeen: "<< my. Cal. business. Days. Between(date 1, date 2) << std: : endl; std: : cout << "End of Month 1. Date: " << my. Cal. end. Of. Month(date 1) << std: : endl; std: : cout << "End of Month 2. Date: " << my. Cal. end. Of. Month(date 2) << std: : endl; return 0; } LOGO
Demo – Day Counter modificatory This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. v v v #include "stdafx. h“ #include <ql/qldefines. hpp> #include <ql/version. hpp> #ifdef BOOST_MSVC # include <ql/auto_link. hpp> #endif v v v #include <ql/time/all. hpp> #include <iostream> using namespace std; using namespace Quant. Lib; int main(array<System: : String ^> ^args) { Calendar my. Cal=Taiwan(); Date new. Years. Eve(31, Dec, 2008); cout << "Name: " << my. Cal. name()<< endl; cout << "New Year is Holiday: " << my. Cal. is. Holiday(new. Years. Eve)<< endl; cout << "New Year is Business Day: " << my. Cal. is. Business. Day(new. Years. Eve)<< endl; v v v cout << "-------- Date Counter ----------" << endl; Date date 1(28, Dec, 2008); Date date 2(04, Jan, 2009); cout << "First Date: " << date 1 << endl; cout << "Second Date: " << date 2 << endl; cout << "Business Days Betweeen: "<< my. Cal. business. Days. Between(date 1, date 2) << endl; cout << "End of Month 1. Date: " << my. Cal. end. Of. Month(date 1) << endl; cout << "End of Month 2. Date: " << my. Cal. end. Of. Month(date 2) << endl; system("pause"); return 0; } LOGO
Reference Documentation LOGO
LOGO End Thanks for you listen.
- Slides: 33