autoCloseAtNextTimestep

In by OptionStackLeave a Comment

The autoCloseAtNextTimestep is a method in the strategy filters used to automatically close the position at the next time step. It can be used with the trackButDoNotTrade method to automatically close tracked positions so that a new position can be re-selected at the next time step based on the latest market conditions.

For example:

  • Time 1: stock = 100
    • track ATM straddle [at-the-money call = 100, at-the-money put = 100]
  • Time 2: stock = 110
    • autoclose prior straddle from Time 1
    • track new ATM straddle [at-the money call = 110, at-the-money put = 110]
  • Time 3: stock = 115
    • autoclose prior straddle from Time 2
    • track new ATM straddle [at-the money call = 115, at-the-money put = 115]

Leave a Comment