Practical C++ Financial Programming
معرفی کتاب «Practical C++ Financial Programming» نوشتهٔ Carlos Oliveira (auth.)، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2015. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Practical C++ Financial Programming» در دستهٔ بدون دستهبندی قرار دارد.
__Practical C++ Financial Programming__ is a hands-on book for programmers wanting to apply C++ to programming problems in the financial industry. The book explains those aspects of the language that are more frequently used in writing financial software, including the STL, templates, and various numerical libraries. The book also describes many of the important problems in financial engineering that are part of the day-to-day work of financial programmers in large investment banks and hedge funds. The author has extensive experience in the New York City financial industry that is now distilled into this handy guide. Focus is on providing working solutions for common programming problems. Examples are plentiful and provide value in the form of ready-to-use solutions that you can immediately apply in your day-to-day work. You’ll learn to design efficient, numerical classes for use in finance, as well as to use those classes provided by Boost and other libraries. You’ll see examples of matrix manipulations, curve fitting, histogram generation, numerical integration, and differential equation analysis, and you’ll learn how all these techniques can be applied to some of the most common areas of financial software development. These areas include performance price forecasting, optimizing investment portfolios, and more. The book style is quick and to-the-point, delivering a refreshing view of what one needs to master in order to thrive as a C++ programmer in the financial industry. * Covers aspects of C++ especially relevant to financial programming. * Provides working solutions to commonly-encountered problems in finance. * Delivers in a refreshing and easy style with a strong focus on the practical. Contents at a Glance 3 Contents 369 About the Author 380 About the Technical Reviewer 381 Acknowledgments 382 Introduction 5 Chapter 1: The Fixed Income Market 9 Fixed Income Overview 10 Why Using C++ 11 Calculating Simple Interest Rates 13 Problem 13 Solution 13 How It Works 13 Complete Code 15 Sample Use 17 Compound Interest 17 Problem 17 Solution 18 How It Works 18 Complete Code 19 Sample Use 22 Modeling Cash Flows 22 Problem 22 Solution 22 Calculating Present Value 22 Calculating Present Value in C++ 23 Using STL Containers 24 Complete Code 25 Running the Code 27 Modeling Bonds 28 Problem 28 Solution 28 Complete Code 29 Running the Code 31 Further Reference 31 Conclusion 31 Chapter 2: The Equities Market 33 Equities Market Concepts 33 Sec2 34 Market Participants 34 Moving Average Calculation 35 Problem 35 Solution 35 Complete Code 38 Running the Code 42 Calculating Volatility 43 Problem 43 Solution 43 Complete Code 45 Running the Code 48 Computing Instrument Correlation 49 Sec15 49 Problem 49 Solution 49 Complete Code 49 Running the Code 54 Calculating Fundamental Indicators 55 Problem 55 Solution 55 Complete Code 56 Running the Code 61 Conclusion 61 Chapter 3: C++ Programming Techniques in Finance 62 Calculating Interest Rates for Investment Instru ments 62 Solution 63 Complete Code 64 Running the Code 69 Creating Financial Statement Objects 69 Solution 69 Smart Pointers 69 Using Auto Pointers 70 Complete Code 71 Transferring Ownership 74 Pitfalls of Auto Pointers 74 Determining Credit Ratings 75 Solution 75 Using Shared Pointers 75 Complete Code 76 Using the auto Keyword 79 Collecting Transaction Data 80 Solution 80 Exception Handling 80 Complete Code 81 Implementing Vector Operations 84 Solution 84 Operator Overloading 85 Complete Code 86 Conclusion 88 Chapter 4: Common Libraries for Financial Applications 90 Handling Analyst Recommendations 91 Solution 91 More About STL Vectors and Maps 91 Complete Code 94 Performing Time-Series Transformations 98 Solution 98 Using STL Algorithms 100 Complete Code 100 Running the Code 103 Copying Transaction Files 103 Solution 103 Boost Libraries 103 Complete Code 107 Running the Code 110 Handling Dates 110 Solution 110 Complete Code 112 Running the Code 116 Conclusion 116 Chapter 5: Designing Numerical Classes 118 Representing Matrices in C++ 118 Solution 118 Complete Code 121 Using Templates to Calculate Factorials 125 Solution 125 Complete Code 128 Running the Code 129 Representing Calmar Ratios at Compile Time 130 Solution 130 Representing Calmar Ratios 131 Complete Code 132 Running the Code 134 Generating Statistical Data 134 Solution 134 Probability Distributions 135 Complete Code 138 Running the Code 141 Conclusion 142 Chapter 6: Plotting Financial Data 143 Plotting with Gnuplot 143 Solution 143 Complete Code 149 Running the Code 153 Plotting Data from a GUI 153 Solution 153 Complete Code 155 Running the Code 159 Conclusion 159 Chapter 7: Linear Algebra 160 Using Basic Linear Algebra Operations 161 Solution 161 Complete Code 163 Using Matrix-Oriented Operations 166 Solution 166 Complete Code 168 Running the Application 173 Calculate the Determinant of a Matrix 173 Solution 173 Complete Code 174 Conclusion 175 Chapter 8: Interpolation 176 Linear Interpolation 176 Solution 176 Complete Code 178 Running the Code 180 Polynomial Interpolation 181 Solution 181 Complete Code 183 Running the Code 186 Conclusion 186 Chapter 9: Calculating Roots of Equations 187 Bisection Method 187 Solution 187 Complete Code 190 Running the Code 193 The Secant Method 193 Solution 193 Complete Code 196 Running the Code 198 Newton’s Method 199 Solution 199 Complete Code 201 Running the Code 204 Conclusion 205 Chapter 10: Numerical Integration 206 The Midpoint Method 206 Solution 206 Complete Code 209 Running the Code 212 Trapezoid Method 212 Solution 212 Complete Code 214 Running the Code 217 Using Simpson’s Method 217 Solution 217 Complete Code 219 Running the Code 221 Conclusion 222 Chapter 11: Solving ODEs and PDEs 223 Solving Ordinary Differential Equations 223 Solution 223 Euler’s Method 225 Complete Code 226 Running the Code 228 Runge-Kutta Method for Solving ODEs 228 Solution 228 Complete Code 229 Running the Code 232 Solving the Black-Scholes Equation 233 Solution 233 Complete Code 234 Running the Code 238 Conclusion 238 Chapter 12: Optimization 239 Interfacing with a Linear Programming Solver 239 Solution 239 Linear Programming Concepts 240 Using LP Solver Libraries 241 Complete Code 242 Running the Code 247 Solving Two-Dimensional Investment Problems 247 Solution 247 Complete Code 249 Running the Code 251 Creating Mixed-Integer Programming Models 252 Solution 252 Complete Code 253 Running the Code 255 Conclusion 256 Chapter 13: Asset and Portfolio Optimization 257 Financial Resource Allocation 257 Solution 257 Implementation 258 Complete Code 259 Running the Code 261 Portfolio Optimization 261 Solution 262 Complete Code 266 Running the Code 269 Extensions to Modified CAP 269 Solution 270 Complete Code 271 Running the Code 274 Conclusion 274 Chapter 14: Monte Carlo Methods 275 Monte Carlo-Based Integral Computation 275 Solution 275 Complete Code 276 Running the Code 280 Simulating Asset Prices 280 Solution 280 Complete Code 282 Running the Code 284 Calculating Option Probabilities 284 Solution 284 Determining Profit Probabilities 285 Complete Code 287 Running the Code 291 Conclusion 291 Chapter 15: Extending Financial Libraries 293 Exporting C++ Stock Handling Code to Python 293 Solution 293 Complete Code 296 Running the Code 300 Exporting C++ Classes Directly to Python 301 Solution 301 Complete Code 303 Running the Code 305 Using Lua as an Extension Language 306 Solution 306 Complete Code 307 Running the Code 313 Conclusion 313 Chapter 16: Using C++ with R and Maxima 314 Integrating C++ with R 314 Solution 314 Complete Code 316 Running the Code 318 Integrating with the Maxima CAS 320 Solution 320 Complete Code 322 Running the Code 324 Conclusion 325 Chapter 17: Multithreading 326 Creating Threads with the Pthreads Library 327 Solution 327 Complete Code 329 Running the Code 332 Calculating Options Probabilities in Parallel 332 Solution 332 Complete Code 333 Running the Code 337 Using Mutexes to Prevent Unsynchronized Access 338 Solution 338 Complete Code 339 Running the Code 342 Conclusion 343 Appendix A: C++11/14 Features 344 Automatic Type Detection 345 Lambdas 346 User-Defined Literals 347 Range-based for 347 Rvalue References 348 New Function Declarator Syntax and Decltype 350 Delegating Constructors 351 Inheriting Constructors 352 Generalized Attributes 353 Generalized Constant Expressions 353 Null Pointer Constant 354 Defaulted and Deleted Member Functions 355 Right-Angle Brackets 356 Initializer Lists 356 Index 359 Practical C++ Financial Programming is a hands-on book for programmers wanting to apply C++ to programming problems in the financial industry. The book explains those aspects of the language that are more frequently used in writing financial software, including the STL, templates, and various numerical libraries. The book also describes many of the important problems in financial engineering that are part of the day-to-day work of financial programmers in large investment banks and hedge funds. The author has extensive experience in the New York City financial industry that is now distilled into this handy guide.℗l Focus is on providing working solutions for common programming problems. Examples are plentiful and provide value in the form of ready-to-use solutions that you can immediately apply in your day-to-day work. Youĺlll learn to design efficient, numerical classes for use in finance, as well as to use those classes provided by Boost and other libraries. Youĺlll see examples of matrix manipulations, curve fitting, histogram generation, numerical integration, and differential equation analysis, and youĺlll learn how all these techniques can be applied to some of the most common areas of financial software development. These areas include performance price forecasting, optimizing investment portfolios, and more. The book style is quick and to-the-point, delivering a refreshing view of what one needs to master in order to thrive as a C++ programmer in the financial industry.℗l Covers aspects of C++ especially relevant to financial programming. Provides working solutions to commonly-encountered problems in finance. Delivers in a refreshing and easy style with a strong focus on the practical.
دانلود کتاب Practical C++ Financial Programming