0.1.9 • Published 6 years ago

bond-calculator v0.1.9

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

Bond calculator

npm version Build Status Coverage Status Greenkeeper badge

Yield and price calculations for bonds.

Gives the same results as Excel YIELD and PRICE functions.

The following day count conventions are supported:

  • 30U/360
  • ACTUAL/ACTUAL
  • ACTUAL/360
  • ACTUAL/365
  • 30E/360

More info about day count conventions can be found on Wikipedia.

Installation

npm install --save bond-calculator

Usage

const bondCalculator = require('bond-calculator');

const bond = bondCalculator({
  settlement: '2016-12-26',
  maturity: '2023-01-17',
  rate: 0.02625, // 2.625%
  redemption: 100,
  frequency: 2, // 1=Annual, 2=Semiannual, 4=Quarterly
  convention: '30U/360',
});

// Calculate yield for a given price
const yld = bond.yield(98); // 2.98817753210426%

// Calculate price for a given yield
const price = bond.price(0.025); // 100.69785390232649
0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago