Skip to content

API Reference

Michael Chu edited this page Oct 4, 2020 · 20 revisions

Standard Parameters

All functions defined in this page have the following common parameters:

  • data (pandas.DataFrame, required): Pandas DataFrame containing the data to generate calls strategies for
  • dte_interval (int, default: 7): An integer representing the exit 'days to expiration' to group generated strategies by
  • max_entry_dte (int, default: 180): An integer representing the max days to expiration on entry to consider
  • exit_dte (int, default: 0): An integer representing the days to expiration on exit, defaults to exit on expiration date
  • otm_pct_interval (float, default: 0.05): A percentage numeral representing the OTM percent to group generated strategies by. (formula: (strike - underlying price) / strike)
  • max_otm_pct (float, default: 1.00): Maximum OTM percentage to consider when generating strategy
  • min_bid_ask (float, default: 0.05): The smallest bid/ask price to consider on entry. This is generally the price at which the option is considered worthless
  • side (str, default: "None"): The side of the strategy to return in output. Possible values are "long", "short"
  • drop_nan (bool, default: True): Remove rows where NaN were returned, likely due to insufficient data
  • raw (bool, default: False): Return generated trades without grouping by dte_interval and otm_pct_interval. Use this flag to return trades only.

optopsy.single_calls

Generates all combinations of call strategies on the specified dataset.


optopsy.single_puts

Generates all combinations of put strategies on the specified dataset.


optopsy.straddles

Generates all valid combinations of straddles on the specified dataset.


optopsy.strangles

Generates all valid combinations of strangles on the specified dataset.

Clone this wiki locally