QS.INSTRUMENT.CDS

Creates a native CreditDefaultSwap contract; use QS.TRADE.CREATE for a position

Category: QuantSupport - Instruments.

QS.INSTRUMENT.CDS(name: text, context: text, start_date: text, maturity_date: text, credit_index: text, discount_index: text, currency: text, spread: number, recovery: number, premium_frequency: text, day_counter: text, start_tenor: text or blank, tenor: text or blank) → text handle
Parameters:
  • name (text) – Workbook-unique object name; unchanged recalculation reuses its current handle

  • context (text) – Required prepared context handle used to build concrete dates and initial contractual terms; construction waits for committed market inputs

  • start_date (text) – ISO date text in YYYY-MM-DD format

  • maturity_date (text) – ISO date text in YYYY-MM-DD format

  • credit_index (text) – Credit market index using the Credit:<entity> form

  • discount_index (text) – Optional instrument discount index; blank leaves policy selection to the pricer; a fixed-income policy may prefer or override this index

  • currency (text) – Three-letter ISO currency code, for example USD or EUR

  • spread (number) – Spread as a decimal, for example 0.001 for 10 basis points

  • recovery (number) – Recovery rate as a decimal between 0 and 1

  • premium_frequency (text) – Required frequency such as Annual, Semiannual, Quarterly, Monthly, or NoFrequency; no blank-input default

  • day_counter (text) – Required day-count convention, for example Actual360, Actual365, or Thirty360; no blank-input default

  • start_tenor (text or blank) – Optional start offset from the evaluation date, e.g. 0D or 1Y; leave start_date blank; built from the explicit construction context

  • tenor (text or blank) – Optional maturity/accrual tenor from resolved start, e.g. 5Y; for swaptions from expiry; leave the corresponding end/maturity date blank

Returns:

Concrete instrument handle built using the supplied construction context. #N/A means construction is pending; no unresolved product handle is published. Pass it to QS.EVALUATE, or use QS.TRADE.CREATE for side, execution date/tenor, quantity or bond anchor.

Return Type:

text handle

Errors:

#VALUE! for invalid contract terms, missing dependencies, native builder errors or registry failures.

Formula

=QS.INSTRUMENT.CDS(name, context, start_date, maturity_date, credit_index, discount_index, currency, spread, recovery, premium_frequency, day_counter, start_tenor, tenor)

Calculation

Runs on Excel’s main calculation thread.

Native Declaration

fn qs_instrument_cds (name : & str , context : & str , start_date : & str , maturity_date : & str , credit_index : & str , discount_index : & str , currency : & str , spread : f64 , recovery : f64 , premium_frequency : & str , day_counter : & str , start_tenor : Option < String > , tenor : Option < String > ,) -> Result < String , XllError >

Rust source