Class EuropeanVanillaOptionFunction
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.tree.EuropeanVanillaOptionFunction
-
- All Implemented Interfaces:
OptionFunction
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class EuropeanVanillaOptionFunction extends Object implements OptionFunction, org.joda.beans.ImmutableBean, Serializable
European vanilla option function.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EuropeanVanillaOptionFunction.Meta
The meta-bean forEuropeanVanillaOptionFunction
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getNumberOfSteps()
Gets the number of time steps.DoubleArray
getPayoffAtExpiryTrinomial(DoubleArray stateValue)
Computes payoff at expiry for trinomial tree.double
getSign()
Gets the sign.double
getStrike()
Gets the strike value.double
getTimeToExpiry()
Gets the time to expiry.int
hashCode()
static EuropeanVanillaOptionFunction.Meta
meta()
The meta-bean forEuropeanVanillaOptionFunction
.EuropeanVanillaOptionFunction.Meta
metaBean()
static EuropeanVanillaOptionFunction
of(double strike, double timeToExpiry, PutCall putCall, int numberOfSteps)
Obtains an instance.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.pricer.impl.tree.OptionFunction
getNextOptionValues, getNextOptionValues, getPayoffAtExpiryTrinomial
-
-
-
-
Method Detail
-
of
public static EuropeanVanillaOptionFunction of(double strike, double timeToExpiry, PutCall putCall, int numberOfSteps)
Obtains an instance.- Parameters:
strike
- the striketimeToExpiry
- the time to expiryputCall
- put or callnumberOfSteps
- the number of time steps- Returns:
- the instance
-
getPayoffAtExpiryTrinomial
public DoubleArray getPayoffAtExpiryTrinomial(DoubleArray stateValue)
Description copied from interface:OptionFunction
Computes payoff at expiry for trinomial tree.The payoff values for individual nodes at expiry are computed from state values at the final layer. For example, the state values represent underlying prices of an option at respective nodes.
- Specified by:
getPayoffAtExpiryTrinomial
in interfaceOptionFunction
- Parameters:
stateValue
- the state values- Returns:
- the payoff at expiry
-
meta
public static EuropeanVanillaOptionFunction.Meta meta()
The meta-bean forEuropeanVanillaOptionFunction
.- Returns:
- the meta-bean, not null
-
metaBean
public EuropeanVanillaOptionFunction.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getStrike
public double getStrike()
Gets the strike value.- Returns:
- the value of the property
-
getTimeToExpiry
public double getTimeToExpiry()
Gets the time to expiry.- Specified by:
getTimeToExpiry
in interfaceOptionFunction
- Returns:
- the value of the property
-
getSign
public double getSign()
Gets the sign.The sign is +1 for call and -1 for put.
- Returns:
- the value of the property
-
getNumberOfSteps
public int getNumberOfSteps()
Gets the number of time steps.- Specified by:
getNumberOfSteps
in interfaceOptionFunction
- Returns:
- the value of the property
-
-