Читать книгу Modern Computational Finance - Antoine Savine - Страница 15

1.7 SCRIPT TEMPLATES

Оглавление

Scripting languages are designed to facilitate the description of any derivatives transaction, and, indeed, all transactions must be scripted to benefit from a common representation within a derivatives system. That means that the pricing, booking, and otherwise manipulation of every transaction, down to vanilla swaps and European options, is conducted with scripts. Traders typically manipulate hundreds to thousands of vanilla swaps or European options every day. Although modern scripting is accessible and user‐friendly, it is still much easier, faster, and less error prone to fill a few fields on a form, like start and end dates, and a fixed coupon for a swap, than to write a script like:

STARTDATE 01Jun2020
ENDDATE 01Jun2030
FLFREQ 3m
FLBASIS act/360
FLIDX L3M
FIXFREQ 1y
FIXBASIS 30/360
CPN 2%
Start: STARTDATE End: ENDDATE Freq: FLFREQ Fixing: start‐2bd swap pays ‐libor( StartPeriod, EndPeriod, FLBASIS, FLIDX) * cvg( StartPeriod, EndPeriod, FLBASIS) on EndPeriod
Start: STARTDATE End: ENDDATE Freq: FIXFREQ Fixing: start‐2bd swap pays CPN * cvg( StartPeriod, EndPeriod, FIXBASIS) on EndPeriod

For those frequently traded products, it is practical to use templates, implemented on spreadsheets or higher level languages, that generate the script automatically out of a small number of inputs.

Templates are typically used for vanilla swaps, European options or first‐generation exotics (short‐term forex barrier options). They combine the practicality of hard‐coded transactions with the benefits of scripting. Many transactions are also regarded as “almost” vanilla swaps, “almost” European, or “almost” standard barriers. In these cases, it is most practical to start with a template and modify the auto‐generated script by hand. Templates are also useful when some transactions are booked in a separate system, which is often the case for, say, vanilla swaps. To aggregate these transactions with the rest of a netting set for the calculation of an xVA, for example, those transactions can be scripted on the fly with template code.

This logic may be pushed a step higher, with the design of GUIs, programmed in a language like C#, so that finance professionals without programming expertise, or customers, may build transactions by assembling blocks on a graphical representation of the transaction. This graphical representation is then automatically turned into the corresponding script.

Writing templates is trivial and a template can be implemented directly in a spreadsheet without code. To write a GUI platform for the design of transactions and translate that graphical representation into a script is perhaps more advanced. It certainly requires an expertise in GUI design, something out of the scope of this publication but covered in many recent C# or Python textbooks.

Modern Computational Finance

Подняться наверх