Book Image

Mastering Python for Finance

Book Image

Mastering Python for Finance

Overview of this book

Table of Contents (17 chapters)
Mastering Python for Finance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Excel for finance


The spreadsheet application in the Microsoft Office suite was designed for statistical, engineering, and financial data management. In finance, Microsoft Excel is used as a handy tool for bond traders and an integral part of banking operations to task automations using VBA. For example, built-in Excel functions, such as TBILLYIELD and DURATION, helps you calculate the yield of a T-bill and the Macaulay duration of a bond and displays these values onto a cell.

Excel supports the use of COM to extend the functionality for custom tasks. This is achieved with the use of COM add-ins as an in-process COM server. With VBA, a wrapper can be created for the COM add-in function so that the COM component can be used as a worksheet cell formula function.

In this chapter, we will take a look at building a COM server in Python. We will then use Microsoft Excel, as our source of data parameters, to perform numerical pricing with the COM object. Using this basic example, we can then extend...