Chapter 3. Introductory Examples

Quantitative analysis, as we define it, is the application of mathematical and/or statistical methods to market data.

John Forman

This chapter dives into some concrete examples from quantitative finance to illustrate how convenient and powerful it is to use Python and its libraries for financial analytics. The focus lies on the flow of the exposition, and a number of details that might be important in real-world applications are not touched upon. Also, details of Python usage are mainly skipped because later chapters explain them further.

Specifically, this chapter presents the following examples:

Implied volatilities
Option quotes for certain maturity dates are taken to back out the implied volatilities of these options and to plot them—a task option traders and risk managers, among others, are faced with on a daily basis.
Monte Carlo simulation
The evolution of a stock index over time is simulated via Monte Carlo techniques, selected results are visualized, and European option values are calculated. Monte Carlo simulation is a cornerstone for numerical option pricing as well as for risk management efforts involving value-at-risk calculations or credit value adjustments.
Technical analysis
An analysis of historical time series data is implemented to backtest an investment strategy based on trend signals; both professional investors and ambitious amateurs regularly engage in this kind of investment analysis.

All examples have to deal in some ...

Get Python for Finance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.