codefinance.training

Coding for Finance

Archives: Books

Clojure for Finance

Apply the Clojure programming language to financial analytics and learn to build financial applications. Work with high-level mathematical abstractions without having to implement low-level code for financial operations.

This is a practical tutorial that takes you through real-world examples of financial analytics and applications with Clojure.

Who This Book Is For

If you’re a finance professional who is currently using VBA (Excel) to perform financial calculations and quantitative analysis, and would like to use Clojure instead to improve their efficiency, then this book is for you. Basic knowledge of financial concepts is essential. Basic programming knowledge would also be an added advantage.

What You Will Learn

  • Quickly and effectively represent data and calculations using Clojure Use Clojure’s basic language tools such as laziness, immutability, and firstclass functions to solve real-world problems.
  • Explore mathematical derivatives to generate different wave forms.
  • Get acquainted with the advanced approaches to calculating and transforming data, and building algorithms.
  • Use Clojure’s functions to access, update, and compose data structures Be introduced to the concept of sideeffecting behavior and the different ways to handle it.
  • Compose simple and exponential functions together to get a buy or sell signalIn DetailClojure is a dynamic programming language with an emphasis on functional programming.

Clojure is well suited to financial modeling allowing developers to work with high-level mathematical abstractions without having to implement low-level code that handles the arithmetic operations. Starting with the importance of representing data and calculations effectively.

First, we introduce the notions of computation and finance, which will help you understand Clojure’s utility to solve real-world problems in many domains, especially finance. Next, we will show you how to develop the simple-moving-average function by using the more advanced partition Clojure data transformation function. This function, along with others, will be used to calculate and manipulate data. You will then learn to implement slightly more complicated equations, how to traverse data, and deal with branching and conditional dispatch. Then, the concept of side-effecting and its various approaches are introduced, along with the strategy of how to use data as the interface to other systems. Finally, you will discover how to build algorithms while manipulating and composing functions. Style and approachThis book is a practical step-by-step tutorial that provides a basic overview of the concepts but focuses on providing the skills required to analyze data.

Chapter 1: Orientation — Addressing the Questions Clojure Answers;
Chapter 2: First Principles and a Useful Way to Think;
Chapter 3: Developing the Simple Moving Average;
Chapter 4: Strategies for Calculating and Manipulating Data;
Chapter 5: Traversing Data, Branching, and Conditional Dispatch;
Chapter 6: Surveying the Landscape;
Chapter 7: Dealing with Side Effects;
Chapter 8: Strategies for Using Macros
Chapter 9: Building Algorithms — Strategies to Manipulate and Compose Functions

Haskell Financial Data Modeling and Predictive Analytics

Haskell is one of the three most influential functional programming languages available today along with Lisp and Standard ML. When used for financial analysis, you can achieve a much-improved level of prediction and clear problem descriptions.

Haskell Financial Data Modeling and Predictive Analytics is a hands-on guide that employs a mix of theory and practice. Starting with the basics of Haskell, this book walks you through the mathematics involved and how this is implemented in Haskell.

The book starts with an introduction to the Haskell platform and the Glasgow Haskell Compiler (GHC). You will then learn about the basics of high frequency financial data mathematics as well as how to implement these mathematical algorithms in Haskell.

You will also learn about the most popular Haskell libraries and frameworks like Attoparsec, QuickCheck, and HMatrix. You will also become familiar with database access using Yesod’s Persistence library, allowing you to keep your data organized. The book then moves on to discuss the mathematics of counting processes and autoregressive conditional duration models, which are quite common modeling tools for high frequency tick data. At the end of the book, you will also learn about the volatility prediction technique.

With Haskell Financial Data Modeling and Predictive Analytics, you will learn everything you need to know about financial data modeling and predictive analytics using functional programming in Haskell.

Financial Modelling: Theory, Implementation and Practice with MATLAB Source

Financial Modelling – Theory, Implementation and Practice with MATLAB Source is a unique combination of quantitative techniques, the application to financial problems and programming using Matlab. The book enables the reader to model, design and implement a wide range of financial models for derivatives pricing and asset allocation, providing practitioners with complete financial modelling workflow, from model choice, deriving prices and Greeks using (semi-) analytic and simulation techniques, and calibration even for exotic options.

The book is split into three parts. The first part considers financial markets in general and looks at the complex models needed to handle observed structures, reviewing models based on diffusions including stochastic-local volatility models and (pure) jump processes. It shows the possible risk-neutral densities, implied volatility surfaces, option pricing and typical paths for a variety of models including SABR, Heston, Bates, Bates-Hull-White, Displaced-Heston, or stochastic volatility versions of Variance Gamma, respectively Normal Inverse Gaussian models and finally, multi-dimensional models. The stochastic-local-volatility Libor market model with time-dependent parameters is considered and as an application how to price and risk-manage CMS spread products is demonstrated.

The second part of the book deals with numerical methods which enables the reader to use the models of the first part for pricing and risk management, covering methods based on direct integration and Fourier transforms, and detailing the implementation of the COS, CONV, Carr-Madan method or Fourier-Space-Time Stepping. This is applied to pricing of European, Bermudan and exotic options as well as the calculation of the Greeks. The Monte Carlo simulation technique is outlined and bridge sampling is discussed in a Gaussian setting and for Lévy processes. Computation of Greeks is covered using likelihood ratio methods and adjoint techniques. A chapter on state-of-the-art optimization algorithms rounds up the toolkit for applying advanced mathematical models to financial problems and the last chapter in this section of the book also serves as an introduction to model risk.

The third part is devoted to the usage of Matlab, introducing the software package by describing the basic functions applied for financial engineering. The programming is approached from an object-oriented perspective with examples to propose a framework for calibration, hedging and the adjoint method for calculating Greeks in a Libor market model.

Source code used for producing the results and analysing the models is provided on the author’s dedicated website, http://www.mathworks.de/matlabcentral/fileexchange/authors/246981.

“This book offers a comprehensive overview of the main derivative pricing models used in practice across various asset classes. Many numerical examples are provided, and precious implementation details are revealed to the financial community. If the devil is in the details, this is one hell of a book!”
Fabio Mercurio, Bloomberg

 

“This book is a dream come true, a must have, a must read and a must use. High-tech financial engineering and numerics are now becoming accessible to the broad quant community.”
Wim Schoutens, Research Professor, University of Leuven

 

“This is a book I wish I’d owned ten years ago to prepare for the exotic derivatives models hype in equity and rates of the first decade. It saves identifying, finding, screening and reading dozens of papers and treats the full life cycle of the models from theory to implementation. The reader can get quickly familiar with the pre-LSV modelling age. With any luck, the Matlab code will also run on octave.”
Uwe Wystup, Professor of Quantitative Finance/ Founder & CEO, MathFinance

 

“This book is a nice exposition for those Quants in Financial Engineering who are interested in an overview of modern pricing and calibration techniques in the field of Financial Derivatives. For those who have a strong mathematical background and are interested in implementation issues, this book is a severe choice.”
Dr. Ingo Schneider, Financial Engineering, DekaBank

Derivatives Analytics with Python

Supercharge options analytics and hedging using the power of Python.
Derivatives Analytics with Python shows you how to implement market-consistent valuation and hedging approaches using advanced financial models, efficient numerical techniques, and the powerful capabilities of the Python programming language. This unique guide offers detailed explanations of all theory, methods, and processes, giving you the background and tools necessary to value stock index options from a sound foundation. You’ll find and use self-contained Python scripts and modules and learn how to apply Python to advanced data and derivatives analytics as you benefit from the 5,000+ lines of code that are provided to help you reproduce the results and graphics presented. Coverage includes market data analysis, risk-neutral valuation, Monte Carlo simulation, model calibration, valuation, and dynamic hedging, with models that exhibit stochastic volatility, jump components, stochastic short rates, and more. The companion website features all code and IPython Notebooks for immediate execution and automation.Python is gaining ground in the derivatives analytics space, allowing institutions to quickly and efficiently deliver portfolio, trading, and risk management results. This book is the finance professional’s guide to exploiting Python’s capabilities for efficient and performing derivatives analytics.

  • Reproduce major stylized facts of equity and options markets yourself
  • Apply Fourier transform techniques and advanced Monte Carlo pricing
  • Calibrate advanced option pricing models to market data
  • Integrate advanced models and numeric methods to dynamically hedge options

Recent developments in the Python ecosystem enable analysts to implement analytics tasks as performing as with C or C++, but using only about one-tenth of the code or even less. Derivatives Analytics with Python — Data Analysis, Models, Simulation, Calibration and Hedging shows you what you need to know to supercharge your derivatives and risk analytics efforts.

Mastering Python for Finance

Key Features

  • Explore advanced financial models used by the industry and ways of solving them using Python
  • Build state-of-the-art infrastructure for modeling, visualization, trading, and more
  • Empower your financial applications by applying machine learning and deep learning

Book Description

The second edition of Mastering Python for Finance will guide you through carrying out complex financial calculations practice in the industry of finance by using next-generation methodologies. You will master the Python ecosystem by leveraging publicly available tools to successfully perform research studies and modelling, and learn to manage risks with the help of advanced examples.

You will start by setting up your Jupyter notebook to implement the tasks throughout the book. You will learn to make efficient and powerful data-driven financial decisions using popular libraries such as TensorFlow, Keras, Numpy, SciPy, and sklearn. You will also learn how to build financial applications by mastering concepts such as stocks, options, interest rates and their derivatives, and risk analytics using computational methods. With these foundations, you will learn to apply statistical analysis to time series data, and understand how time series data is useful for implementing an event-driven backtesting system and for working with high-frequency data in building an algorithmic trading platform. Finally, you will explore machine learning and deep learning techniques that are applied in finance.

By the end of this book, you will be able to apply Python to different paradigms in the financial industry and perform efficient data analysis.

What you will learn

  • Solve linear and nonlinear models representing various financial problems
  • Perform principal component analysis on the DOW index and its components
  • Analyze, predict, and forecast stationary and non-stationary time series processes
  • Create an event-driven backtesting tool and measure your strategies
  • Build a high-frequency algorithmic trading platform with Python
  • Replicate the CBOT VIX index with SPX options for studying VIX-based strategies
  • Perform regression-based and classification-based machine learning tasks for prediction
  • Use TensorFlow and Keras in deep learning neural network architecture

Who this book is for

If you are a financial or data analyst or a software developer in the financial industry who is interested in using advanced Python techniques for quantitative methods in finance, this is the book you need! You will also find this book useful if you want to extend the functionalities of your existing financial applications by using smart machine learning techniques. Prior experience in Python is required.

Python for Finance – 2nd Ed.

The financial industry has recently adopted Python at a tremendous rate, with some of the largest investment banks and hedge funds using it to build core trading and risk management systems. Updated for Python 3, the second edition of this hands-on book helps you get started with the language, guiding developers and quantitative analysts through Python libraries and tools for building financial applications and interactive financial analytics. Using practical examples throughout the book, author Yves Hilpisch also shows you how to develop a full-fledged framework for Monte Carlo simulation-based derivatives and risk analytics, based on a large, realistic case study. Much of the book uses interactive IPython Notebooks.

Financial Instrument Pricing Using C++ 2nd Ed.

This complete guide to C++ and computational finance is a follow-up and major extension to Daniel J. Duffy’s 2004 edition of Financial Instrument Pricing Using C++. Both C++ and computational finance have evolved and changed dramatically in the last ten years and this book documents these improvements. Duffy focuses on these developments and the advantages for the quant developer by:

  • Delving into a detailed account of the new C++11 standard and its applicability to computational finance.
  • Using de-facto standard libraries, such as Boost and Eigen to improve developer productivity.
  • Developing multiparadigm software using the object-oriented, generic, and functional programming styles.
  • Designing flexible numerical algorithms: modern numerical methods and multiparadigm design patterns.
  • Providing a detailed explanation of the Finite Difference Methods through six chapters, including new developments such as ADE, Method of Lines (MOL), and Uncertain Volatility Models.
  • Developing applications, from financial model to algorithmic design and code, through a coherent approach.
  • Generating interoperability with Excel add-ins, C#, and C++/CLI.
  • Using random number generation in C++11 and Monte Carlo simulation.

Duffy adopted a spiral model approach while writing each chapter of Financial Instrument Pricing Using C++ 2e: analyse a little, design a little, and code a little. Each cycle ends with a working prototype in C++ and shows how a given algorithm or numerical method works. Additionally, each chapter contains non-trivial exercises and projects that discuss improvements and extensions to the material.

This book is for designers and application developers in computational finance, and assumes the reader has some fundamental experience of C++ and derivatives pricing.

 

Source Code is Available

Once you have purchased a copy of the book please send an email to the author dduffyATdatasim.nl requesting your personal and non-transferable copy of the source code. Proof of purchase is needed. The subject of the mail should be “C++ Book Source Code Request”. You will receive a reply with a zip file attachment.

Practical Quantitative Finance with ASP.NET Core and Angular

This book provides comprehensive details of developing ultra-modern, responsive single-page applications (SPA) for quantitative finance using ASP.NET Core and Angular. It pays special attention to create distributed web SPA applications and reusable libraries that can be directly used to solve real-world problems in quantitative finance. The book contains:

  • Overview of ASP.NET Core and Angular, which is necessary to create SPA for quantitative finance.
  • Step-by-step approaches to create a variety of Angular compatible real-time stock charts and technical indicators using ECharts and TA-Lib.
  • Introduction to access market data from online data sources using .NET Web API and Angular service, including EOD, intraday, real-time stock quotes, interest rates.
  • Detailed procedures to price equity options and fixed-income instruments using QuantLib, including European/American/Barrier/Bermudan options, bonds, CDS, as well as related topics such as cash flows, term structures, yield curves, discount factors, and zero-coupon bonds.
  • Detailed explanation to linear analysis and machine learning in finance, which covers linear regression, PCA, KNN, SVM, and neural networks.
  • In-depth descriptions of trading strategy development and backtesting for crossover and z-score based trading signals.

Practical C# and WPF for Financial Markets

Practical C# and WPF for Financial Markets provides a complete explanation of .NET programming in quantitative finance. It demonstrates how to implement quant models and backtest trading strategies. It pays special attention to creating business applications and reusable C# libraries that can be directly used to solve real-world problems in quantitative finance. The book contains:

  • Overview of C#, WPF programming, data binding, and MVVM pattern, which is necessary to create MVVM compatible .NET financial applications.
  • Step-by-step approaches to create a variety of MVVM compatible 2D/3D charts, stock charts, and technical indicators using my own chart package and Microsoft chart control.
  • Introduction to free market data retrieval from online data sources using .NET interfaces. These data include EOD, real-time intraday, interest rate, foreign exchange rate, and option chain data.
  • Detailed procedures to price equity options and fixed-income instruments, including European/American/Barrier options, bonds, and CDS, as well as discussions on related topics such as cash flows, term structures, yield curves, discount factors, and zero-coupon bonds.
  • Introduction to linear analysis, time series analysis, and machine learning in finance, which covers linear regression, PCA, SVM, and neural networks.
  • In-depth descriptions of trading strategy development and backtesting, including strategies for single stock trading, stock pairs trading, and trading for multi-asset portfolios.

C# for Financial Markets

A practice-oriented guide to using C# to design and program pricing and trading models

In this step-by-step guide to software development for financial analysts, traders, developers and quants, the authors show both novice and experienced practitioners how to develop robust and accurate pricing models and employ them in real environments. Traders will learn how to design and implement applications for curve and surface modeling, fixed income products, hedging strategies, plain and exotic option modeling, interest rate options, structured bonds, unfunded structured products, and more. A unique mix of modern software technology and quantitative finance, this book is both timely and practical. The approach is thorough and comprehensive and the authors use a combination of C# language features, design patterns, mathematics and finance to produce efficient and maintainable software.

Designed for quant developers, traders and MSc/MFE students, each chapter has numerous exercises and the book is accompanied by a dedicated companion website, http://www.datasimfinancial.com/forum/viewforum.php?f=196&sid=f30022095850dee48c7db5ff62192b34, providing all source code, alongside audio, support and discussion forums for readers to comment on the code and obtain new versions of the software.