Skip to content

Can't calculate price with a negative yield #13

@thatsjohnson

Description

@thatsjohnson

Description

Can't calculate price with a negative yield. This matches current Excel capabilities, but this is a valid calculation for computing price of a bond.

Repro steps

Please provide the steps required to reproduce the problem

  1. Call Calculators.CalcPrice(settlement, maturity, coupon, yield, 100), using a negative yield value (-0.002)

Expected behavior

return value of Price.
http://www.investopedia.com/ask/answers/06/negativeyieldbond.asp

Actual behavior

Exception thrown: 'System.Exception' in ExcelFinancialFunctions.dll
Additional information: yld must be more than 0

Known workarounds

None.

Related information

  • Windows 10
  • Master Branch
  • .NET Runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreadyFix is ready in a feature branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions