Table of Contents

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

original InstrumentResults

Properties

AdditionalResults

Gets any additional results the engine returns, by tag.

public ImmutableSortedDictionary<string, object> AdditionalResults { get; init; }

Property Value

ImmutableSortedDictionary<string, object>

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

ErrorEstimate

Gets the error estimate on the NPV, when the engine gives one.

public double? ErrorEstimate { get; init; }

Property Value

double?

NPV

Gets the net present value.

public double? NPV { get; init; }

Property Value

double?

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

other InstrumentResults

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Result<T>(string)

An additional result, by its tag: QuantLib's Instrument::result<T>.

public T Result<T>(string tag)

Parameters

tag string

The result's tag.

Returns

T

The result.

Type Parameters

T

The result's type.

Exceptions

ArgumentNullException

tag is null.

NanoQLException

No additional result has the tag.

InvalidCastException

The result isn't a T, where QuantLib's std::any_cast throws std::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

string

Operators

operator ==(InstrumentResults?, InstrumentResults?)

public static bool operator ==(InstrumentResults? left, InstrumentResults? right)

Parameters

left InstrumentResults
right InstrumentResults

Returns

bool

operator !=(InstrumentResults?, InstrumentResults?)

public static bool operator !=(InstrumentResults? left, InstrumentResults? right)

Parameters

left InstrumentResults
right InstrumentResults

Returns

bool