close_leg: Close single leg options trade

Description Usage Arguments Value

Description

Using function inputs from opened trades close each day until expiration

Usage

1
2
close_leg(df, entry_date, exp, typ, stk, entry_mid, entry_delta, stk_price,
  direction)

Arguments

df

dataframe of opened options legs

entry_date

date position was opened

exp

date of expiration for position used to filter possible results

typ

is this a put or a call option

stk

option strike price

entry_mid

mid price of the position when opened

entry_delta

delta of the strike when position was opened

stk_price

stock price when position was opened

direction

was this a short or long position used to calc profit

Value

A dataframe of filtered closing option trades to be used in further analysis. One row for each day a posistion was open open_date +1 through expiration


themechanicalbear/tastytrade documentation built on June 28, 2019, 10:16 p.m.