contract: Convert To And From Class 'contract'

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/contract.R

Description

Constructor function to create an option contract object from component elements, or from related classes.

Usage

1
2
3
4
5
6
7
8
contract(underlying., expiry., strike., right.)

as.contract(x, ...)

## S3 method for class 'character'
as.contract(x, ...)
## S3 method for class 'osi'
as.contract(x, ...)

Arguments

underlying.

The character string of the underlying symbol.

expiry.

The expiration date of the contract. May be a time object of class POSIXt or Date, or a character string coercible to.

strike.

Numeric value up to the limit of the OSI.

right.

The right confered, ‘p’ or ‘put’ for puts, or ‘c’ or ‘call’ for calls. Case insensitive.

x

Object to convert.

...

Unused.

Details

This function allows for automatic generation of arbitrary contract details as required by the OSI identifier format. There are no checks for sanity beyond the input type validation.

Value

An object of type contract.

Author(s)

Jeffrey A. Ryan

References

http://www.theocc.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf

See Also

osi

Examples

1
2
3
4
5
6
7
8
9
ppl <- contract("PPL",        # Pennsylvania Power and Light underlying
                "2012-10-20", # Expiration date (third Saturday)
                29,           # Striking price
                "c")          # Call
ppl

as.contract("PPL  121020P00029000")

as.contract(as.osi("PPL  121020P00029000"))

joshuaulrich/greeks documentation built on May 19, 2019, 8:54 p.m.