ATM_k: At-the-money strike

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

Description

Returns the At-The-Money strike price of an option chain

Usage

1
ATM_k(options, verbose = TRUE)

Arguments

options

vector of option names that have been previously defined

verbose

be verbose?

Details

Very preliminary version. Currently, you give it a bunch of names of options, it gets the most recent price of the underlying using getQuote and returns the strike price that is closest to the last price. See notes.

Value

numeric

Note

TODO: I would like to extend this so that (1)you only need to give it an underlying (2)if you give it several underlyings, it will give you list or named vector of strikes (3)include an argument for expiration date

Author(s)

Garrett See

See Also

ATMQuote ls_options, ls_underlyings, ls_strikes, ls_instruments_by

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
option_series.yahoo('SPY')
ATM_k(ls_options())
ATM_k(ls_options('SPY', match=FALSE))
ATM_k(ls_options(ls_instruments_by('underlying_id','SPY')))

Exp <- ls_expiries(underlying_id='SPY', type='option')[1] #1st expiry of SPY options
ATM_k(ls_by_expiry(Exp))

## End(Not run)

gsee/twsInstrument documentation built on May 17, 2019, 8:55 a.m.