Class EuropeanVanillaOptionFunction

    • Method Detail

      • of

        public static EuropeanVanillaOptionFunction of​(double strike,
                                                       double timeToExpiry,
                                                       PutCall putCall,
                                                       int numberOfSteps)
        Obtains an instance.
        Parameters:
        strike - the strike
        timeToExpiry - the time to expiry
        putCall - put or call
        numberOfSteps - 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 interface OptionFunction
        Parameters:
        stateValue - the state values
        Returns:
        the payoff at expiry
      • 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 interface OptionFunction
        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 interface OptionFunction
        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object