Skip to content

Commit 29f8fa7

Browse files
committed
expose error_estimate
1 parent 70409b5 commit 29f8fa7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

quantlib/_instrument.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cdef extern from 'ql/instrument.hpp' namespace 'QuantLib':
1111
Instrument()
1212
bool isExpired()
1313
Real NPV() except +
14+
Real errorEstimate() except +
1415
Date& valuationDate() except +
1516
void setPricingEngine(shared_ptr[PricingEngine]&)
1617
T result[T](const string& tag)

quantlib/instrument.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ cdef class Instrument(Observable):
2525
def __get__(self):
2626
return self._thisptr.get().NPV()
2727

28+
@property
29+
def error_estimate(self) -> Real:
30+
"""error estimate on the NPV when available"""
31+
return self._thisptr.get().errorEstimate()
32+
2833
property npv:
2934
""" Shortcut to the net_present_value property. """
3035
def __get__(self):

0 commit comments

Comments
 (0)