qis.InstrumentLeg¶
- class qis.InstrumentLeg(instrument_type, underlying_id, quantity, multiplier=1.0, strike=None)[source]¶
Bases:
objectA signed primitive valued in its underlying’s quote currency.
- Variables:
instrument_type (qis.portfolio.stress.instruments.InstrumentType) – Primitive enum.
underlying_id (str) – Actual quote ID in the portfolio registry.
quantity (float) – Signed number of units; negative means short.
multiplier (float) – Positive contract multiplier.
strike (float | None) – Nonnegative option strike; absent for funded assets and futures.
- Parameters:
instrument_type (InstrumentType)
underlying_id (str)
quantity (float)
multiplier (float)
strike (float | None)
- __init__(instrument_type, underlying_id, quantity, multiplier=1.0, strike=None)¶
- Parameters:
instrument_type (InstrumentType)
underlying_id (str)
quantity (float)
multiplier (float)
strike (float | None)
- Return type:
None
Methods
__init__(instrument_type, underlying_id, ...)get_payoff(quotes, spot0)Evaluate signed model value locally, before currency conversion.
get_quote_delta(spot0, kink_policy)Return current local derivative with respect to the actual quote.
Attributes
- instrument_type: InstrumentType¶
- get_quote_delta(spot0, kink_policy)[source]¶
Return current local derivative with respect to the actual quote.
For an option the call slope is one above the strike and zero below; the put slope is the call slope minus one.
kink_policysets the call slope only whenspot0 == strikeexactly, with no tolerance.- Parameters:
spot0 (float) – Quote at which the derivative is taken: the baseline quote for current risk, or a scenario quote for scenario-local bands.
kink_policy (KinkPolicy) – Common one-sided derivative policy for this holding.
- Returns:
Signed units including multiplier and intrinsic exercise state.
- Return type: