input
stringlengths
10
828
output
stringlengths
5
107
public string get long format return get long format string
returns the name of time unit in long format e
public string get short format return get short format string
returns the name of time unit in short format e
private string get long format string string builder sb new string builder sb append to string to lower case sb set length sb length 1 return sb to string
output time units in long format e
public date next date final string imm code return next date imm code true date null date
returns next main cycle imm date from the given imm code
private string get short format string string builder sb new string builder sb append to string to lower case sb set length 1 return sb to string
output time units in short format e
public string get long format return get internal long format
returns the name of period in long format
protected boolean is added holiday date date return added holidays contains date true
check whether holiday is artificially added
public date next date final string imm code boolean main cycle return next date imm code main cycle date null date
returns next imm date from the given imm code
public string get short format return get internal short format
returns the name of period in short format 3 letters
public boolean is business day final date date if is added holiday date return false return true
this base class only checks in list added by add holiday date call
private string get internal long format string suffix if this length 1 suffix else suffix s string builder sb new string builder formatter formatter new formatter sb locale us formatter format d s s this length this units get long format suffix return sb to string
returns periods in long format e
public string next code return next code date null date
returns next main cycle imm code from the reference date
private string get internal short format string builder sb new string builder formatter formatter new formatter sb locale us formatter format d s this length this units get short format return sb to string
output periods in short format e
public string next code final date d return next code d true
returns next cycle imm code from the specified date
public string next code final string imm code return next code imm code true
returns next main cycle imm code from the given imm code
public string next code final string imm code boolean main cycle return next code imm code main cycle date null date
returns next imm code from the given imm code
public type get generic type return get generic type 0
gets the referenced type of the first generic parameter
public type get generic type final int n return this types n
gets the referenced type of the n th generic parameter
protected void wrapped notify observer observer observable observable object arg observer update observable arg
this method is intended to encapsulate the notification semantics in
static public month value of int month switch month case 1 return month january case 2 return month february case 3 return month march case 4 return month april case 5 return month may case 6 return month june case 7 return month july case 8 return month august case 9 return month september case 10 return month october case 11 return month november case 12 return month december default throw new illegal argument exception
returns a new month given its ordinal number
public char get imm char switch enum value case 1 return f case 2 return g case 3 return h case 4 return j case 5 return k case 6 return m case 7 return n case 8 return q case 9 return u case 10 return v case 11 return x case 12 return z default throw new illegal argument exception
returns the imm char for this month
static public month value of char imm code switch imm code case f return month january case g return month february case h return month march case j return month april case k return month may case m return month june case n return month july case q return month august case u return month september case v return month october case x return month november case z return month december default throw new illegal argument exception
returns a new month given its imm code
public date get max date return date factory get max date
returns a instance that is the maximum date that can be represented by
public date get min date return date factory get min date
returns a instance that is the minimum date that can be represented by
public date get todays date return date factory get todays date
returns todays date represented by the system
public date get date int day month month int year return date factory get date day month year
returns a date represented by parameters specified
public preferences get preferences return this preferences
returns preferences set on the configuration
public void enable multiple settings this multiple settings true
enables creation of multiple settings per configuration
public boolean is leap int year return date factory is leap year
check whether given year is leap year or not
public settings get global settings return global settings
returns the global settings of the configuration
public settings new settings if multiple settings return new settings preferences return null
to create a new settings instance
public boolean is extra safety checks return extra safety checks
whether to enforce extra checks on the calculations or not
public void set todays payments final boolean todays payments this todays payments todays payments
changes the value of field todays payments
public boolean is enforces todays historic fixings return enforces todays historic fixings
enforce todays historic fixings
public void set evaluation date final date evaluation date this evaluation date get updatable update evaluation date
changes the value of field evaluation date
public void set evaluation date final date evaluation date this set evaluation date evaluation date
changes the value of field evaluation date
public calendar fixing calendar return new null calendar
inflation indices do not have fixing calendars
public period availability lag return availability lag
the availability lag describes when the index is
public void add fixing final date date final double value add fixing date value false
stores the historical fixing at the given date
public boolean has occurred final date d read only return has occurred d new settings is todays payments
returns true if an event has already occurred before a date
protected void setup arguments final pricing engine arguments a read only throw new library exception setup arguments not implemented
passes arguments to be used by a
protected void setup expired read only npv 0 0 error estimate 0 0
this method must leave the instrument in a consistent
public double npv final leg cashflows final interest rate irr final date settlement date date date settlement date if date is null date new settings evaluation date final yield term structure flat rate new flat forward date irr rate irr day counter irr compounding irr frequency return npv cashflows new handle yield term structure flat rate date date 0
npv of the cash flows
public object result final string key read only return this additional results get key
returns any additional result returned by the pricing engine
public double bps final leg cashflows final interest rate irr date settlement date if settlement date is null settlement date new settings evaluation date final yield term structure flat rate new flat forward settlement date irr rate irr day counter irr compounding irr frequency return bps cashflows new handle yield term structure flat rate settlement date settlement date
basis point sensitivity of the cash flows
public double clean price return dirty price accrued amount settlement date
theoretical clean price
public double duration final leg leg final interest rate y final duration duration final date settlement date date date settlement date if date is null date new settings evaluation date switch duration case simple return simple duration leg y date case modified return modified duration leg y date case macaulay return macaulay duration leg y date default throw new library exception unknown duration type qa rg verified
cash flow duration
public double dirty price return settlement value notional settlement date 100 0
theoretical dirty price
public int to integer return value
this method returns the i mathematical signal i associated to an option type
public void pre adjust values if closeness is close enough time latest pre adjustment pre adjust values impl latest pre adjustment time
this method will be invoked after rollback and before any other asset
public void post adjust values if closeness is close enough time latest post adjustment post adjust values impl latest post adjustment time
this method will be invoked after rollback and after any other asset
public void adjust values pre adjust values post adjust values
this method performs both pre and post adjustment
protected void pre adjust values impl nothing
this method performs the actual pre adjustment
protected void post adjust values impl nothing
this method performs the actual post adjustment
public forward type payoff final position position type final price double strike super ql require strike 0 0 negative strike given todo message this strike strike this type position type
constructs a typed
public boolean empty read only return impl null
returns whether or not the day counter is initialized
public long day count final date date start final date date end read only ql require impl null no implementation provided return impl day count date start date end
returns the number of days between two dates
protected long day count final date date start final date date end read only return date end sub date start
to be overloaded by more complex day counters
final public cash flow next cash flow final leg cash flows date settlement if settlement is null settlement new settings evaluation date for int i 0 i cash flows size i the first coupon paying after d is the one we re after if cash flows get i has occurred settlement return cash flows get i return null cash flows get cash flows size
note should return null when no cashflow could be found
final public int next cash flow index final leg cash flows date settlement if settlement is null settlement new settings evaluation date for int i 0 i cash flows size i the first coupon paying after d is the one we re after if cash flows get i has occurred settlement return i return cash flows size
note returns the index for cashflow
final private double basis point value final leg leg final interest rate y final date settlement date real final double shift 0 0001 real final double dirty price npv leg y settlement date real final double modified duration duration leg y duration modified settlement date real final double convexity convexity leg y settlement date real double delta modified duration dirty price real double gamma convexity 100 0 dirty price delta shift gamma shift shift return delta 0 5 gamma
basis point value obtained by setting dy 0
public array params read only int size 0 for int i 0 i arguments size i size arguments get i size final array params new array size int k 0 for int i 0 i arguments size i for int j 0 j arguments get i size j k final double value arguments get i params get j params set k value return params
p returns array of arguments on which calibration is done
public int day of year read only return int serial number year offset year
one based jan 1st 1
public string name read only return impl name
returns the name of the calendar
public period sub assign final period another return this add assign another clone negative
returns code this code period subtracted code another code period
public period div assign final int scalar if scalar 0 throw new arithmetic exception division by zero error if this length scalar 0 keep the original units if the user created a 24 months period he ll probably want a 12 months one when he halves it this length scalar else switch this units case years this units time unit months this length 12 break case weeks this units time unit days this length 7 break if this length scalar 0 this length this length scalar else throw new library exception cannot be divided by scalar return this
returns code this code period divided by a scalar
public period mul final int scalar return new period scalar this length this units
returns code this code period multiplied by a scalar
public date end of month final date d read only return adjust date end of month d business day convention preceding
returns last business day of the month to which the given date belongs
static public weekday value of final int value switch value case 1 return weekday sunday case 2 return weekday monday case 3 return weekday tuesday case 4 return weekday wednesday case 5 return weekday thursday case 6 return weekday friday case 7 return weekday saturday default throw new library exception value must be 1 7 todo message
returns a new weekday object given its cardinality
public void add holiday final date d if d was a genuine holiday previously removed revert the change impl removed holidays remove d if it s already a holiday leave the calendar alone otherwise add it if impl is business day d impl added holidays add d
adds a date to the set of holidays for the given calendar
public period add final period another return this clone add assign another
returns code this code period added code another code period
public int value return enum value
returns the week day as a number where sunday 1 till saturday 7
public void remove holiday final date d if d was an artificially added holiday revert the change impl added holidays remove d if it s already a business day leave the calendar alone otherwise add it if impl is business day d impl removed holidays add d
removes a date from the set of holidays for the given calendar
private string get as short format final string builder sb new string builder sb append this sb set length 3 return sb to string
returns the name of weekdays in short format 3 letters
public period sub final period another return this clone sub assign another
returns code this code period subtracted code another code period
private string get as shortest format final string builder sb new string builder sb append this sb set length 2 return sb to string
returns the name of weekdays in shortest format 2 letters
public date adjust final date date read only return adjust date business day convention following
adjusts a non business day to the appropriate near business day
public period div final int scalar return this clone div assign scalar
returns code this code period divided by a scalar
public boolean eq final period another return this equals another
compares code this code to code another code period
public boolean neq final period another return this equals another
compares code this code to code another code period
public boolean gt final period another return another lt this
compares code this code to code another code period
public date advance final date date final period period read only return advance date period business day convention following false
advances the given date as specified by the given period and
public boolean le final period another return this lt another this eq another
compares code this code to code another code period
public boolean ge final period another return another le this
compares code this code to code another code period
public long sub final date another return serial number another serial number
difference in days between dates
public int business days between final date from final date to read only return business days between from to true false
calculates the number of business days between two given dates and
protected int easter monday final int y return easter monday y 1901
expressed relative to first day of year
private string get short format string string builder sb new string builder sb append to string char at 0 return sb to string
output time units in short format e
public char get imm char final char return char switch enum value case 1 return char f break case 2 return char g break case 3 return char h break case 4 return char j break case 5 return char k break case 6 return char m break case 7 return char n break case 8 return char q break case 9 return char u break case 10 return char v break case 11 return char x break case 12 return char z break default throw new library exception value must be 1 12 todo message return return char
returns the imm char for this month
public schedule schedule return new schedule effective date termination date tenor calendar convention termination date convention rule end of month first date next to last date
make schedule operator schedule const return schedule effective date
public double elasticity final double spot read only final double val value final double del delta spot if val constants ql epsilon return del val spot else if math abs del constants ql epsilon return 0 0 else if del 0 0 return double max value else return double min value
sensitivity in percent to a percent change in the underlying spot price
public double elasticity forward read only final double val value final double del delta forward if val constants ql epsilon return del val forward else if math abs del constants ql epsilon return 0 0 else if del 0 0 return double max value else return double min value
sensitivity in percent to a percent change in the underlying forward
public double gamma final double spot read only ql require spot 0 0 positive spot value required final double dforward ds forward spot final double temp std dev spot final double dalpha ds d alpha d d1 temp final double dbeta ds d beta d d2 temp final double d2alpha ds2 dalpha ds spot 1 d1 std dev final double d2beta ds2 dbeta ds spot 1 d2 std dev final double temp2 d2alpha ds2 forward 2 0 dalpha ds dforward ds d2beta ds2 x 2 0 dbeta ds d x d s return discount temp2
second order derivative with respect to change in the underlying spot
private int get min days switch this units case years return this length 365 case months return this length 28 case weeks return this length 7 case days return this length default throw new library exception unknown time unit
converts period to days
public double gamma forward read only final double temp std dev forward final double dalpha dforward d alpha d d1 temp final double dbeta dforward d beta d d2 temp final double d2alpha dforward2 dalpha dforward forward 1 d1 std dev final double d2beta dforward2 dbeta dforward forward 1 d2 std dev final double temp2 d2alpha dforward2 forward 2 0 dalpha dforward d2beta dforward2 x dxdforward 0 0 commented in the source quant lib return discount temp2
second order derivative with respect to change in the underlying forward
private int get max days switch this units case years return this length 366 case months return this length 31 case weeks return this length 7 case days return this length default throw new library exception unknown time unit
converts period to days
public double theta per day final double spot time final double maturity read only return theta spot maturity 365 0
sensitivity to time to maturity per day assuming 365 day per year
public double rho final time double maturity read only ql require maturity 0 0 negative maturity not allowed actually dalpha dr t final double dalpha dr d alpha d d1 std dev final double dbeta dr d beta d d2 std dev final double temp dalpha dr forward alpha forward dbeta dr x return maturity discount temp value
sensitivity to discounting rate
public double dividend rho final time double maturity read only ql require maturity 0 0 negative maturity not allowed actually dalpha dq t final double dalpha dq d alpha d d1 std dev final double dbeta dq d beta d d2 std dev final double temp dalpha dq forward alpha forward dbeta dq x return maturity discount temp
sensitivity to dividend growth rate
public double itm cash probability read only return cum d2
probability of being in the money in the bond martingale measure i