Class CashOrNothingPayoff
- java.lang.Object
-
- org.jquantlib.instruments.Payoff
-
- org.jquantlib.instruments.TypePayoff
-
- org.jquantlib.instruments.StrikedTypePayoff
-
- org.jquantlib.instruments.CashOrNothingPayoff
-
- All Implemented Interfaces:
- PolymorphicVisitable
public class CashOrNothingPayoff extends StrikedTypePayoff
Binary cash-or-nothing payoff which pays off nothing if the underlying asset price finishes below/above the strike price , or pays out a predetermined constant amount if the underlying asset finishes above/below the strike price.Definitions of Binary path-independent payoffs can be found in M. Rubinstein, E. Reiner:"Unscrambling The Binary Code", Risk, Vol.4 no.9,1991.
- See Also:
- Binary Options
-
-
Constructor Summary
Constructors Constructor and Description CashOrNothingPayoff(Option.Type type, double strike, double cashPayoff)Constructs a typedPayoffwith a fixed strike price and the policy of a cash-or-nothing payoff
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaccept(PolymorphicVisitor pv)This method is intended to extend the semantics of methodVisitable.accept(Visitor)java.lang.Stringdescription()doubleget(double price)Returns the value of anInstrumentat maturity underPayoffconditionsdoublegetCashPayoff()java.lang.Stringname()-
Methods inherited from class org.jquantlib.instruments.StrikedTypePayoff
strike
-
Methods inherited from class org.jquantlib.instruments.TypePayoff
optionType
-
-
-
-
Constructor Detail
-
CashOrNothingPayoff
public CashOrNothingPayoff(Option.Type type, double strike, double cashPayoff)
Constructs a typedPayoffwith a fixed strike price and the policy of a cash-or-nothing payoff- Parameters:
type- is anOption.Typestrike- is the strike pricecashPayoff- is the cash payoff value
-
-
Method Detail
-
getCashPayoff
public final double getCashPayoff()
- Returns:
- the cash payoff value
-
description
public java.lang.String description()
- Overrides:
descriptionin classStrikedTypePayoff
-
get
public final double get(double price)
Returns the value of anInstrumentat maturity underPayoffconditionsPays off nothing if the underlying asset price finishes below/above the strike price , or pays out a predermined constant amount if the underlying asset finishes above/below the strike price.
- CALL Option: if , otherwise zero
- PUT Option: if , otherwise zero
where is the asset price at maturity and is the predetermined cash payoff
-
accept
public void accept(PolymorphicVisitor pv)
Description copied from interface:PolymorphicVisitableThis method is intended to extend the semantics of methodVisitable.accept(Visitor)In a conventional Visitor design pattern, the
acceptmethod is called when access to visit a data structure is requested. AVisitorobject is passed as argument in case permission is granted to thatVisitorto access the data structure. Obviously,Visitors andVisitables work in pairs and the class which provides the data structure to be visited also implementsVisitablein order to properly grant access when the expectedVisitoris received.In the case of a
PolymorphicVisitable, aPolymorphicVisitoris passed instead of aVisitor. APolymorphicVisitoris in fact, a composition ofVisitors and not only a singleVisitor. APolymorphicVisitoris responsible for returning the correctVisitorresponsible for processing a certain data structure.The initial design of pairs made of <
Visitor,Visitable> is extended to a concept of a matrix made of multipleVisitors against multipleVisitables. Every class which implementsPolymorphicVisitablepasses different data structures when queryingPolymorphicVisitors.- Specified by:
acceptin interfacePolymorphicVisitable- Overrides:
acceptin classPayoff- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG