Bojan Nikolic: Using and Understanding the QuantLib Addin

[website home] | [BN Algorithms]

qlStrikedTypePayoff – create a definition of a derivative payoff

Usage:

=qlStrikedTypePayoff(<ObjPrefix>,
                     <PayoffID>, <OptionType>, <Strike>,
                     <ThirdParameter>)
<ObjPrefix>

Optional prefix for names of objects created with this function

<PayoffID>
Defines the type of the payoff. It must be one of:
  • Vanilla

  • PercentageStrike

  • AssetOrNothing

  • CashOrNothing

  • Gap

  • SuperFund

  • SuperShare

<OptionType>

Type of option: Call or Put

<Strike>

The strike of the option as a number

<ThirdParameter>

Optional third parameter which meaning depends on the value of <PayoffID>

Here is example usage in QLW – QuantLib-Addin like interface from Java and Python

// Copyright (C) 2012 Bojan Nikolic <bojan@bnikolic.co.uk>
//

import co.uk.bnikolic.qlw.property_t;
import co.uk.bnikolic.qlw.qlw;
import co.uk.bnikolic.qlw.StringVector;
import co.uk.bnikolic.qlw.LongVector;
import co.uk.bnikolic.qlw.PropertyVector;

public class qlStrikedTypePayoff {

    public static void main(String[] args) throws Exception {
        String payoff=qlw.qlStrikedTypePayoff("payoff", 
                                              "Vanilla", 
                                              "Call", 
                                              110.0,
                                              qlw.OH_NULL(),
                                              qlw.OH_NULL(),
                                              qlw.OH_NULL(),
                                              false
                                              );
    }
}