Class InstrumentResults
- Namespace
- NanoQL
- Assembly
- NanoQL.dll
The results an engine returns for an instrument.
public record InstrumentResults : IEquatable<InstrumentResults>
- Inheritance
-
InstrumentResults
- Implements
- Derived
- Inherited Members
Remarks
A result QuantLib leaves null is null: where QuantLib throws "not provided" on reading it, the caller checks for the null. Equality compares every member by value, the additional results key by key, and a collection among them element by element.
Constructors
InstrumentResults()
public InstrumentResults()
InstrumentResults(InstrumentResults)
protected InstrumentResults(InstrumentResults original)
Parameters
originalInstrumentResults
Properties
AdditionalResults
Gets any additional results the engine returns, by tag.
public ImmutableSortedDictionary<string, object> AdditionalResults { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
ErrorEstimate
Gets the error estimate on the NPV, when the engine gives one.
public double? ErrorEstimate { get; init; }
Property Value
NPV
Gets the net present value.
public double? NPV { get; init; }
Property Value
ValuationDate
Gets the date the NPV refers to.
public Date? ValuationDate { get; init; }
Property Value
- Date?
Exceptions
- ArgumentException
Set to
default(Date), which is not a valid date.
Methods
Equals(InstrumentResults?)
public virtual bool Equals(InstrumentResults? other)
Parameters
otherInstrumentResults
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Result<T>(string)
An additional result, by its tag: QuantLib's Instrument::result<T>.
public T Result<T>(string tag)
Parameters
tagstringThe result's tag.
Returns
- T
The result.
Type Parameters
TThe result's type.
Exceptions
- ArgumentNullException
tagis null.- NanoQLException
No additional result has the tag.
- InvalidCastException
The result isn't a
T, where QuantLib'sstd::any_castthrowsstd::bad_any_cast: .NET's own type for a failed cast, since the failure is the type argument's.
ToString()
public override string ToString()
Returns
Operators
operator ==(InstrumentResults?, InstrumentResults?)
public static bool operator ==(InstrumentResults? left, InstrumentResults? right)
Parameters
leftInstrumentResultsrightInstrumentResults
Returns
operator !=(InstrumentResults?, InstrumentResults?)
public static bool operator !=(InstrumentResults? left, InstrumentResults? right)
Parameters
leftInstrumentResultsrightInstrumentResults