Modern Computational Finance
eBook - ePub

Modern Computational Finance

Scripting for Derivatives and xVA

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Modern Computational Finance

Scripting for Derivatives and xVA

About this book

An incisive and essential guide to building a complete system for derivative scripting 

In Volume 2 of Modern Computational Finance Scripting for Derivatives and xVA, quantitative finance experts and practitioners Drs. Antoine Savine and Jesper Andreasen deliver an indispensable and insightful roadmap to the interrogation, aggregation, and manipulation of cash-flows in a variety of ways. The book demonstrates how to facilitate portfolio-wide risk assessment and regulatory calculations (like xVA). 

Complete with a professional scripting library written in modern C++, this stand-alone volume walks readers through the construction of a comprehensive risk and valuation tool. This essential book also offers: 

  • Effective strategies for improving scripting libraries, from basic examples—like support for dates and vectors—to advanced improvements, including American Monte Carlo techniques 
  • Exploration of the concepts of fuzzy logic and risk sensitivities, including support for smoothing and condition domains 
  • Discussion of the application of scripting to xVA, complete with a full treatment of branching 

Perfect for quantitative analysts, risk professionals, system developers, derivatives traders, and financial analysts, Modern Computational Finance Scripting for Derivatives and xVA: Volume 2 is also a must-read resource for students and teachers in master's and PhD finance programs. 

Trusted by 375,005 students

Access to over 1.5 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Publisher
Wiley
Year
2021
Print ISBN
9781119540786
eBook ISBN
9781119540793
Edition
1
Subtopic
Finanzwesen

PART I
A Scripting Library in C++

Introduction

This part leads readers through the development steps of the scripting library provided in our source repository.
A transaction consists of a number of events occurring on given dates in the future. This is where a payment or coupon is fixed, a discrete barrier is monitored, or an exercise takes place. This is also where a path‐dependency is updated with reference to the simulated variables on that future date.1 Future dates when such events take place are called event dates.
As an illustration, we consider a simplified version of the popular autocallable transaction. It pays a high coupon (say 10%) if some index (say S&P500) increased during the first year of its life. In this case, it pays the notional redemption together with the coupon of 10% and terminates at the end of year 1. Otherwise, it may still deliver a 20% coupon (10% per annum) at the end of year 2 provided the index overall increased over the two years. In this case, it repays the notional together with the 20% coupon and terminates at the end of year 2. If not, it is given a last chance on year 3, provided the underlying index increased over the three years. If this is the case, the investor receives the redemption + 30% at the end of year 3. If not, only 50% of the notional is repaid. It is easy to see that the investor implicitly sells a (somewhat exotic) option on what may appear as a low probability event (index decreasing over one, two, and three years) in exchange for a high coupon in a low‐yield environment, which explains the success of this structure.2 This product may be scripted as follows (say today is 1 June 2020)3:
01Jun2020 vRef=spot()
vAlive=1
01Jun2021 if spot() > vRef then
prd=110
vAlive=0
endIf
01Jun2022 if spot() > vRef then
if vAlive=1 then prd=120 endIf
vAlive=0
endIf
01Jun2023 if vAlive=1 then
if spot() > vRef then prd=130 else prd=50 endIf
endIf
We have four events on four event dates:
  1. Today, we set the reference to the current spot level and initialize the alive status to 1.
  2. Year 1, we check whether the spot increased, in which case we pay redemption + 10% and die.
  3. Year 2, we check that the spot overall increased over two years. In this case, provided we survived year 1, we pay redemption + 20% and die.
  4. Year 3, provided we survived the first two, we check if the spot overall increased. In this case we pay redemption + 30%. If not, we repay 50% of the notional.
We see that our language must at the very minimum support numbers, arithmetic operations, and conditional statements. We know we also need some mathematical functions like
images
or
images
and some financial functions such as a multi‐argument
images
and
images
. Critically, we must be able to read, write, and compare variables and access the simulated market with a spot() keyword that references the fixing of the underlying asset on the corresponding event date. This is a simple language, similar to Python, that supports only the constructs necessary for the description of financial cash‐flows, for which it provides some specific keywords.
The language considers as a variable anything that starts with a letter and is not otherwise a keyword. We used the variables
images
,
images
, and
images
in our example. Evidently, ancillary variable names don't have to start with the letter V; this is only for clarity.
Products are variables. The language makes no difference between products and ancilla...

Table of contents

  1. Cover
  2. Table of Contents
  3. Title Page
  4. Copyright
  5. My Life in Script by Jesper Andreasen
  6. PART I: A Scripting Library in C++
  7. PART II: Basic Improvements
  8. PART III: Advanced Improvements
  9. PART IV: Fuzzy Logic and Risk Sensitivities
  10. PART V: Application to xVA
  11. APPENDIX A: APPENDIX AParsing
  12. Bibliography
  13. Index
  14. End User License Agreement

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.5M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1.5 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Modern Computational Finance by Antoine Savine,Jesper Andreasen in PDF and/or ePUB format, as well as other popular books in Mathematik & Finanzwesen. We have over 1.5 million books available in our catalogue for you to explore.