New Options Backtester
Search, filter, and sort 65,769,505 backtests

Backtesting

Tuesday, July 9th 2019

How to Backtest Exiting a Spread When One of the Legs Goes In-The-Money

Backtest exiting an options trade whenever any leg reaches a delta or percentage out-of-the-money. A case study example here of a put butterfly is shown.

Summary

The ORATS Backtester can exit an options trade whenever any leg reaches a delta or percentage out-of-the-money. The 'Exit Leg on Strike Trigger' can be used to control any leg of the spread. The optimizer can be used to run variations of the strategy and results can be filtered and sorted to find the best strategy. A case study example of a put butterfly is shown.

The ORATS Backtester can exit an options trade whenever any leg reaches a delta or percentage out-of-the-money.

Here's how to set this up based on this user's question:

I’m back-testing a put broken wing fly, where leg 1 is atm, leg 2 is 5% otm, and leg 3 is 15% otm. I’m trying to add an exit condition where if market closes below the short strike (i.e. 5% below where the trade started in this example), the position is closed and a new one is entered. How do I code this exit condition to exit when the middle leg of the fly (which starts as an out of the money put with perhaps a -.35 delta) goes in the money?

Use the ‘Exit Leg on Strike Trigger’ to control any leg of the spread.

Here you would set a max stockOTMpct of 1 as the exit trigger.

 

With the Exit Leg on Strike Trigger you can use the dropdown to select any leg (here leg 2 exit if the percent OTM goes above the max of 100%) and use the '+' button to add more legs.

Here's how to set up the strike selection for this strategy.

 

Next steps? Try the optimizer for this strategy.

Run a few more variations of the strategy. Here I varied the days to expiration, OTM percentage, and spread yield percentage. When the backtests have completed, click on the boxes to the left of each description. The 'Optimize' button will appear. Click that and all the variations will be run with each other and the results returned in a sortable and filterable table.

 

I filtered the table by Worst Month Return greater than 4% and sorted the table by Sharpe Ratio.

 

The top strategy has 90 DTE, 85% / 95% / 100% OTM strike percentages for the put butterfly legs, and a spread yield target of 0% with min of collecting -0.5% and max of paying +0.5% for the fly.

 

 

 

 

Contact Us
Curious about enterprise pricing? Want to become an affiliate? Questions about our data? Let us know.
Your email
Your message
Submit
ORATSORATS
Institutional Quality Tools for All Options Traders
(312) 986 - 1060
support@orats.com
36 Maplewood Ave, Portsmouth, NH 03801
Trading Tools
APIs
Historical Data
More Information