Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Python for Finance

You're reading from   Mastering Python for Finance Implement advanced state-of-the-art financial statistical applications using Python

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789346466
Length 426 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
James Ma Weiming James Ma Weiming
Author Profile Icon James Ma Weiming
James Ma Weiming
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Section 1: Getting Started with Python FREE CHAPTER
2. Overview of Financial Analysis with Python 3. Section 2: Financial Concepts
4. The Importance of Linearity in Finance 5. Nonlinearity in Finance 6. Numerical Methods for Pricing Options 7. Modeling Interest Rates and Derivatives 8. Statistical Analysis of Time Series Data 9. Section 3: A Hands-On Approach
10. Interactive Financial Analytics with the VIX 11. Building an Algorithmic Trading Platform 12. Implementing a Backtesting System 13. Machine Learning for Finance 14. Deep Learning for Finance 15. Other Books You May Enjoy

Valuing a zero-coupon bond

A zero-coupon bond is a bond that does not pay any periodic interest except on maturity, where the principal or face value is repaid. Zero-coupon bonds are also called pure discount bonds.

A zero-coupon bond can be valued as follows:

Here, y is the annually-compounded yield or rate of the bond, and t is the time remaining to the maturity of the bond.

Let's take a look at an example of a five-year zero-coupon bond with a face value of $100. The yield is 5%, compounded annually. The price can be calculated as follows:

A simple Python zero-coupon bond calculator can be used to illustrate this example:

In [ ]:
def zero_coupon_bond(par, y, t):
"""
Price a zero coupon bond.

:param par: face value of the bond.
:param y: annual yield or rate of the bond.
:param t: time to maturity, in years.
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image