@travishorn/financejs
    Preparing search index...

    Function mduration

    • Returns the modified Macauley duration for a security with an assumed par value of $100.

      Modified duration is defined as:

      MDURATION = DURATION / (1 + yld / frequency)
      

      Remarks:

      • settlement, maturity, frequency, and basis are truncated to integers.
      • If settlement or maturity is not a valid date, an error is thrown.
      • If coupon < 0 or if yld < 0, an error is thrown.
      • If frequency is any number other than 1, 2, or 4, an error is thrown.
      • If basis < 0 or if basis > 4, an error is thrown.
      • If settlement >= maturity, an error is thrown.

      Parameters

      • settlement: Date

        The security's settlement date.

      • maturity: Date

        The security's maturity date.

      • coupon: number

        The security's annual coupon rate.

      • yld: number

        The security's annual yield.

      • frequency: 1 | 2 | 4

        The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.

      • Optionalbasis: 0 | 1 | 2 | 4 | 3 = 0

        The type of day count basis to use. 0 or omitted = US (NASD 30/360), 1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360.

      Returns number

      The modified Macauley duration.

      mduration(new Date("2008-01-01"), new Date("2016-01-01"), 0.08, 0.09, 2, 1); // 5.73566981