63,99 €
Leverage Python for expert-level volatility and variance derivative trading Listed Volatility and Variance Derivatives is a comprehensive treatment of all aspects of these increasingly popular derivatives products, and has the distinction of being both the first to cover European volatility and variance products provided by Eurex and the first to offer Python code for implementing comprehensive quantitative analyses of these financial products. For those who want to get started right away, the book is accompanied by a dedicated Web page and a Github repository that includes all the code from the book for easy replication and use, as well as a hosted version of all the code for immediate execution. Python is fast making inroads into financial modelling and derivatives analytics, and recent developments allow Python to be as fast as pure C++ or C while consisting generally of only 10% of the code lines associated with the compiled languages. This complete guide offers rare insight into the use of Python to undertake complex quantitative analyses of listed volatility and variance derivatives. * Learn how to use Python for data and financial analysis, and reproduce stylised facts on volatility and variance markets * Gain an understanding of the fundamental techniques of modelling volatility and variance and the model-free replication of variance * Familiarise yourself with micro structure elements of the markets for listed volatility and variance derivatives * Reproduce all results and graphics with IPython/Jupyter Notebooks and Python codes that accompany the book Listed Volatility and Variance Derivatives is the complete guide to Python-based quantitative analysis of these Eurex derivatives products.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 181
Veröffentlichungsjahr: 2016
Founded in 1807, John Wiley & Sons is the oldest independent publishing company in the United States. With offices in North America, Europe, Australia and Asia, Wiley is globally committed to developing and marketing print and electronic products and services for our customers' professional and personal knowledge and understanding.
The Wiley Finance series contains books written specifically for finance and investment professionals as well as sophisticated individual investors and their financial advisors. Book topics range from portfolio management to e-commerce, risk management, financial engineering, valuation and financial instrument analysis, as well as much more.
For a list of available titles, visit our Web site at www.WileyFinance.com.
A Python-based Guide
DR. YVES J. HILPISCH
This edition first published 2017© 2017 Yves Hilpisch
Registered officeJohn Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom
For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please visit our website at www.wiley.com.
The right of the author to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. It is sold on the understanding that the publisher is not engaged in rendering professional services and neither the publisher nor the author shall be liable for damages arising herefrom. If professional advice or other expert assistance is required, the services of a competent professional should be sought.
Library of Congress Cataloging-in-Publication Data is available
A catalogue record for this book is available from the British Library.
ISBN 978-1-119-16791-4 (hbk) ISBN 978-1-119-16792-1 (ebk)ISBN 978-1-119-16793-8 (ebk) ISBN 978-1-119-16794-5 (ebk)
Cover Design: WileyTop Image: © grapestock/ShutterstockBottom Image: © stocksnapper/iStock
Preface
Part One: Introduction to Volatility and Variance
Chapter 1: Derivatives, Volatility and Variance
1.1 Option Pricing and Hedging
1.2 Notions of Volatility and Variance
1.3 Listed Volatility and Variance Derivatives
1.4 Volatility and Variance Trading
1.5 Python as Our Tool of Choice
1.6 Quick Guide Through the Rest of the Book
Chapter 2: Introduction to Python
2.1 Python Basics
2.2 NumPy
2.3 matplotlib
2.4 pandas
2.5 Conclusions
Chapter 3: Model-Free Replication of Variance
3.1 Introduction
3.2 Spanning with Options
3.3 Log Contracts
3.4 Static Replication of Realized Variance and Variance Swaps
3.5 Constant Dollar Gamma Derivatives and Portfolios
3.6 Practical Replication of Realized Variance
3.7 VSTOXX as Volatility Index
3.8 Conclusions
Part Two: Listed Volatility Derivatives
Chapter 4: Data Analysis and Strategies
4.1 Introduction
4.2 Retrieving Base Data
4.3 Basic Data Analysis
4.4 Correlation Analysis
4.5 Constant Proportion Investment Strategies
4.6 Conclusions
Chapter 5: VSTOXX Index
5.1 Introduction
5.2 Collecting Option Data
5.3 Calculating the Sub-Indexes
5.4 Calculating the VSTOXX Index
5.5 Conclusions
5.6 Python Scripts
Chapter 6: Valuing Volatility Derivatives
6.1 Introduction
6.2 The Valuation Framework
6.3 The Futures Pricing Formula
6.4 The Option Pricing Formula
6.5 Monte Carlo Simulation
6.6 Automated Monte Carlo Tests
6.7 Model Calibration
6.8 Conclusions
6.9 Python Scripts
Chapter 7: Advanced Modeling of the VSTOXX Index
7.1 Introduction
7.2 Market Quotes for Call Options
7.3 The SRJD Model
7.4 Term Structure Calibration
7.5 Option Valuation by Monte Carlo Simulation
7.6 Model Calibration
7.7 Conclusions
7.8 Python Scripts
Chapter 8: Terms of the VSTOXX and its Derivatives
8.1 The EURO STOXX 50 Index
8.2 The VSTOXX Index
8.3 VSTOXX Futures Contracts
8.4 VSTOXX Options Contracts
8.5 Conclusions
Part Three: Listed Variance Derivatives
Chapter 9: Realized Variance and Variance Swaps
9.1 Introduction
9.2 Realized Variance
9.3 Variance Swaps
9.4 Variance vs. Volatility
9.5 Conclusions
Chapter 10: Variance Futures at Eurex
10.1 Introduction
10.2 Variance Futures Concepts
10.3 Example Calculation for a Variance Future
10.4 Comparison of Variance Swap and Future
10.5 Conclusions
Chapter 11: Trading and Settlement
11.1 Introduction
11.2 Overview of Variance Futures Terms
11.3 Intraday Trading
11.4 Trade Matching
11.5 Different Traded Volatilities
11.6 After the Trade Matching
11.7 Further Details
11.8 Conclusions
Part Four: DX Analytics
Chapter 12: DX Analytics – An Overview
12.1 Introduction
12.2 Modeling Risk Factors
12.3 Modeling Derivatives
12.4 Derivatives Portfolios
12.5 Conclusions
Chapter 13: DX Analytics – Square-Root Diffusion
13.1 Introduction
13.2 Data Import and Selection
13.3 Modeling the VSTOXX Options
13.4 Calibration of the VSTOXX Model
13.5 Conclusions
13.6 Python Scripts
Chapter 14: DX Analytics – Square-Root Jump Diffusion
14.1 Introduction
14.2 Modeling the VSTOXX Options
14.3 Calibration of the VSTOXX Model
14.4 Calibration Results
14.5 Conclusions
14.6 Python Scripts
Bibliography
Index
EULA
Table 5.1
Table 8.1
Table 8.2
Figure 1.1
Figure 1.2
Figure 1.3
Figure 1.4
Figure 1.5
Figure 2.1
Figure 2.2
Figure 2.3
Figure 2.4
Figure 2.5
Figure 2.6
Figure 2.7
Figure 2.8
Figure 2.9
Figure 2.10
Figure 3.1
Figure 3.2
Figure 3.3
Figure 3.4
Figure 3.5
Figure 4.1
Figure 4.2
Figure 4.3
Figure 4.4
Figure 4.5
Figure 4.6
Figure 4.7
Figure 4.8
Figure 4.9
Figure 4.10
Figure 4.11
Figure 4.12
Figure 4.13
Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 6.5
Figure 6.6
Figure 6.7
Figure 6.8
Figure 7.1
Figure 7.2
Figure 7.3
Figure 7.4
Figure 7.5
Figure 7.6
Figure 7.7
Figure 7.8
Figure 7.9
Figure 8.1
Figure 8.2
Figure 8.3
Figure 9.1
Figure 9.2
Figure 9.3
Figure 9.4
Figure 9.5
Figure 9.6
Figure 9.7
Figure 10.1
Figure 10.2
Figure 10.3
Figure 10.4
Figure 10.5
Figure 11.1
Figure 11.2
Figure 12.1
Figure 12.2
Figure 12.3
Figure 13.1
Figure 13.2
Figure 14.1
Figure 14.2
Figure 14.3
Figure 14.4
Figure 14.5
Figure 14.6
Figure 14.7
Figure 14.8
Figure 14.9
Figure 14.10
Figure 14.11
Figure 4.4
Figure 4.5
Figure 4.6
Figure 4.7
Figure 4.8
Figure 4.9
Figure 4.10
Figure 4.11
Figure 4.12
Figure 4.13
Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 6.5
Figure 6.6
Figure 6.7
Figure 6.8
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
55
56
57
58
59
60
61
62
63
64
65
66
67
71
72
73
74
75
76
78
79
80
81
83
85
86
87
88
89
90
91
92
93
95
96
97
98
99
100
101
102
103
104
105
106
108
110
111
112
114
116
117
118
123
127
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
145
146
147
148
149
150
152
153
154
155
156
157
158
159
160
161
162
163
167
171
174
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
195
196
197
198
199
200
201
202
203
205
207
209
210
212
215
221
222
223
224
225
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
265
266
268
269
270
271
272
273
274
275
276
277
278
279
280
283
284
285
286
287
288
289
290
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
315
316
317
318
319
320
321
322
323
324
325
331
332
334
345
Cover
Table of Contents
Volatility and variance trading has evolved from something opaque to a standard tool in today’s financial markets. The motives for trading volatility and variance as an asset class of its own are numerous. Among others, it allows for effective option and equity portfolio hedging and risk management as well as straight out speculation on future volatility (index) movements. The potential benefits of volatility- and variance-based strategies are widely accepted by researchers and practitioners alike.
With regard to products it mainly started out around 1993 with over-the-counter (OTC) variance swaps. At about the same time, the Chicago Board Options Exchange introduced the VIX volatility index. This index still serves today – after a significant change in its methodology – as the underlying risk factor for some of the most liquidly traded listed derivatives in this area. The listing of such derivatives allows for a more standardized, cost efficient and transparent approach to volatility and variance trading.
This book covers some of the most important listed volatility and variance derivatives with a focus on products provided by Eurex. Larger parts of the content are based on the Eurex Advanced Services tutorial series which use Python to illustrate the main concepts of volatility and variance products. I am grateful that Eurex allowed me to use the contents of the tutorial series freely for this book.
Python has become not only one of the most widely used programming languages but also one of the major technology platforms in the financial industry. It is more like a platform since the Python ecosystem provides a wealth of powerful libraries and packages useful for financial analytics and application building. It also integrates well with many other technologies, like the statistical programming language R, used in the financial industry. You can find links to all Python resources under http://lvvd.tpq.io.
I thank Michael Schwed for providing parts of the Python code. I also thank my family for all their love and support over the years, especially my wife Sandra and our children Lilli and Henry. I dedicate this book to my beloved dog Jil. I miss you.
YVES
Voelklingen, Saarland, April 2016
The first chapter provides some background information for the rest of the book. It mainly covers concepts and notions of importance for later chapters. In particular, it shows how the delta hedging of options is connected with variance swaps and futures. It also discusses different notions of volatility and variance, the history of traded volatility and variance derivatives as well as why Python is a good choice for the analysis of such instruments.
In the Black-Scholes-Merton (1973) benchmark model for option pricing, uncertainty with regard to the single underlying risk factor S (stock price, index level, etc.) is driven by a geometric Brownian motion with stochastic differential equation (SDE)
Throughout we may think of the risk factor as being a stock index paying no dividends. St is then the level of the index at time t, μ the constant drift, σ the instantaneous volatility and Zt is a standard Brownian motion. In a risk-neutral setting, the drift μ is replaced by the (constant) risk-less short rate r
In addition to the index which is assumed to be directly tradable, there is also a risk-less bond B available for trading. It satisfies the differential equation
In this model, it is possible to derive a closed pricing formula for a vanilla European call option C maturing at some future date T with payoff max [ST − K, 0], K being the fixed strike price. It is
where
The price of a vanilla European put option P with payoff max [K − ST, 0] is determined by put-call parity as
There are multiple ways to derive this famous Black-Scholes-Merton formula. One way relies on the construction of a portfolio comprised of the index and the risk-less bond that perfectly replicates the option payoff at maturity. To avoid risk-less arbitrage, the value of the option must equal the payoff of the replicating portfolio. Another method relies on calculating the risk-neutral expectation of the option payoff at maturity and discounting it back to the present by the risk-neutral short rate. For detailed explanations of these approaches refer, for example, to Björk (2009).
Yet another way, which we want to look at in a bit more detail, is to perfectly hedge the risk resulting from an option (e.g. from the point of view of a seller of the option) by dynamically trading the index and the risk-less bond. This approach is usually called delta hedging (see Sinclair (2008), ch. 1). The delta of a European call option is given by the first partial derivative of the pricing formula with respect to the value of the risk factor, i.e. . More specifically, we get
When trading takes place continuously, the European call option position hedged by δt index units short is risk-less:
This is due to the fact that the only (instantaneous) risk results from changes in the index level and all such (marginal) changes are compensated for by the delta short index position.
Continuous models and trading are a mathematically convenient description of the real world. However, in practice trading and therefore hedging can only take place at discrete points in time. This does not lead to a complete breakdown of the delta hedging approach, but it introduces hedge errors. If hedging takes place at every discrete time interval of length Δt, the Profit-Loss (PL) for such a time interval is roughly (see Bossu (2014), p. 59)
Γ is the gamma of the option and measures how the delta (marginally) changes with the changing index level. ΔS is the change in the index level over the time interval Δt. It is given by
Θ is the theta of the option and measures how the option value changes with the passage of time. It is given approximately by (see Bossu (2014), p. 60)
With this we get
The quantity is called the dollar gamma of the option and gives the second order change in the option price induced by a (marginal) change in the index level. is the squared realized return over the time interval Δt – it might be interpreted as the (instantaneously) realized variance if the time interval is short enough and the drift is close to zero. Finally, is the fixed, “theoretical” variance in the model for the time interval.
The above reasoning illustrates that the PL of a discretely delta hedged option position is determined by the difference between the realized variance during the discrete hedge interval and the theoretically expected variance given the model parameter for the volatility. The total hedge error over intervals is given by
This little exercise in option hedging leads us to a result which is already quite close to a product intensively discussed in this book: listed variance futures. Variance futures, and their Over-the-Counter (OTC) relatives variance swaps, pay to the holder the difference between realized variance over a certain period of time and a fixed variance strike.
The previous section already touches on different notions of volatility and variance. This section provides formal definitions for these and other quantities of importance. For a more detailed exposition refer to Sinclair (2008). In what follows we assume that a time series is given with quotes Sn, n ∈ {0, …, N} (see Hilpisch (2015, ch. 3)). We do not assume any specific model that might generate the time series data. The log return for n > 0 is defined by
realized or historical volatility
: this refers to the standard deviation of the log returns of a financial time series; suppose we observe
N
(past) log returns
R
n
,
n
∈ {1, …,
N
}, with mean return
; the realized or historical volatility
is then given by
instantaneous volatility
: this refers to the volatility factor of a diffusion process; for example, in the Black-Scholes-Merton model the instantaneous volatility σ is found in the respective (risk-neutral) stochastic differential equation (SDE)
implied volatility
: this is the volatility that, if put into the Black-Scholes-Merton option pricing formula, gives the market-observed price of an option; suppose we observe today a price of
C
*
0
for a European call option; the implied volatility σ
imp
is the quantity that solves
ceteris paribus
the implicit equation
These volatilities all have squared counterparts which are then named variance
