|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--webcab.lib.finance.options.OptionStrategies
This class evaluates the payoff functions of a number of different option trading strategies. We will consider spreads which involve taking a position in two or more options of the same type and combinations which involve taking positions in both calls and puts on the same underlying asset.
| Constructor Summary | |
OptionStrategies()
Creates a new instance. |
|
| Method Summary | |
double |
payOffBearSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
Returns the payoff at expiry for the Bear Spread. |
double |
payOffBullSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
Returns the payoff at expiry for the Bull Spread. |
double |
payOffButterflySpread(double expiryPrice,
double broughtCallHigh,
double broughtCallLow,
double soldCalls)
Returns the payoff at expiry for the Butterfly Spread. |
double |
payOffSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
Returns the payoff function of a spread of bull or bear type. |
double |
payOffStraddleCombination(double strike,
double expiryPrice)
We implement the payoff function for the Straddle Combination which involves taking a long position in a call option and a long position in a put option with the same strike price and expiration date. |
double |
payOffStrangleCombination(double expiryPrice,
double callStrike,
double putStrike)
We implement the payoff function for the Strangle Combination consists of a long position in a call option and a put option with different strike prices and the same expiry date. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OptionStrategies()
| Method Detail |
public double payOffBullSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
throws OptionsException,
OptionStrategiesDemoException
buyCallStrike - strike of the brought call optionsoldCallStrike - strike of the sold call optionexpiryPrice - expiry price of the underlying asset
OptionsException - thrown when the parameter given do not represent a Bull Spread
OptionStrategiesDemoException
public double payOffBearSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
throws OptionsException,
OptionStrategiesDemoException
soldCallStrike is less than buyCallStrike. The individual entering
into this contract will gain if the price falls.
buyCallStrike - strike of the brought call optionsoldCallStrike - strike of sold call optionexpiryPrice - expiry price of the underlying asset
OptionsException - thrown when the parameter provided do not represent a Bear Spread
OptionStrategiesDemoException
public double payOffSpread(double expiryPrice,
double buyCallStrike,
double soldCallStrike)
throws OptionsException,
OptionStrategiesDemoException
buyCallStrike - strike of the brought call optionsoldCallStrike - strike of sold optionexpiryPrice - expiry price
OptionException - thrown when the parameter given do not represent the a (Bull or Bear) Spread strategy
OptionsException
OptionStrategiesDemoException
public double payOffButterflySpread(double expiryPrice,
double broughtCallHigh,
double broughtCallLow,
double soldCalls)
throws OptionsException,
OptionStrategiesDemoException
Description of a Butterfly Spread
This trading strategy involves the use of three options with different strikes. To construct the spread the investor must buy a call option with a relatively high strike and a relatively low strike price, and sell two options with a strike midway. Generally, the butterfly spread is constructed with the midpoint close to the present market value. In this case the investor will gain if the price at expiry is close to its present price and will take a small loss if the price moves significantly in either direction.
broughtCallHigh - strike of first brought call optionbroughtCallLow - strike of second brought call optionsoldCalls - the strike of the two sold call optionsexpiryPrice - expiry price
OptionException - thrown when the parameters provided do not represent a Butterfly Spread
OptionsException
OptionStrategiesDemoException
public double payOffStraddleCombination(double strike,
double expiryPrice)
throws OptionStrategiesDemoException
strike - the strike of the put and callexpiryPrice - expiry price of the underlying asset
OptionException - thrown when the parameter provided do not represent a Straddle Combination
OptionStrategiesDemoException
public double payOffStrangleCombination(double expiryPrice,
double callStrike,
double putStrike)
throws OptionsException,
OptionStrategiesDemoException
callStrike - strike of the call optionputStrike - strike of the put optionexpiryPrice - price of the underlying asset at expiry
OptionsException - thrown when the parameters provided do not represent a Strangle Combination
OptionStrategiesDemoException
|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||