Greetings everyone! I am not familiar with back testing options - nor coding for options yet - and would like to know if this is possible.

On the first trading day of the week after the market opens, buy x number of at-the-money call/put options based on the previous weeks' trend. Close position 1) if the option bid price drops X% below or 2) on the last trading day of the week 15 minutes before market close. (Note: I did not use Monday/Friday to account for holidays)

Up-trend example: Monday, October 25th 2021, TQQQ opens at $142.95. The previous weeks open/close was $134.28 and $141.25, respectively. On the 30M chart, the 50 EMA is trending up. After market open, purchase TQQQ weekly Oct 29 $143.00 calls at market price. Sell on the last trading day of the week unless stopped out before then.  

The same logic holds for the down-trend example just in reverse.

A few things to consider:

  1. For back testing purposes, perhaps it would be best to allow the user to choose either the first day of the week or any specific day of the week (i.e. Wednesday).
  2. I understand there are no ‘Stop Loss' orders with Options, but we should be able to continue checking the option price and, when it reaches a certain level, liquidate. 

 

Thanks!!