Main Content

opprofit

Description

example

Profit = opprofit(AssetPrice,Strike,Cost,PosFlag,OptType) returns the profit of an option.

Examples

collapse all

This example shows how to return the profit of an option. For example, consider buying (going long on) a call option with a strike price of $90 on an underlying asset with a current price of $100 for a cost of $4.

Profit = opprofit(100, 90, 4, 0, 0)
Profit = 6

Input Arguments

collapse all

Asset price, specified as a scalar or a NINST-by-1 vector.

Data Types: double

Strike or exercise price, specified as a scalar or a NINST-by-1 vector.

Data Types: double

Cost of the option, specified as a scalar or a NINST-by-1 vector.

Data Types: double

Option position, specified as a scalar or a NINST-by-1 vector using the values 0 (long) or 1 (short).

Data Types: logical

Option type, specified as a scalar or a NINST-by-1 vector using the values 0 (call option) or 1 (put option).

Data Types: logical

Output Arguments

collapse all

Option profit, returned as a scalar or a NINST-by-1 vector.

Version History

Introduced before R2006a