Using the ORATS backtester, there are many ways to delta hedge a strategy using hedging with the underlying stock. You can delta hedge every certain number of days or hedge if the position reaches certain delta levels. There are also ways to under hedge, for example, only hedge 50% of the delta.
First a primer, delta hedging usually means buying or selling the underlying to offset a position in options that has a negative or positive delta. For example, if an at-the-money straddle is purchased and the price of the underlying goes up, there will be a positive delta in the straddle. The positive delta straddle will make more if the stock continues to go up than it would make if the stock were to go down. The trader may want to sell the underlying to offset the asymmetric profit picture.
If the trader wishes to get flat at the end of every day, there is a feature of the backtester called Hedge Days, here set to 1 hedging every day at the close:
For the long straddle in SPY, there returns are not very good for a delta neutral strategy returning -4.77% annually. However, the delta neutral strategy did perform better than not hedging that had an annual return of -6.67%. The delta neutral strategy also had a better (lower) annual volatility of 3.63% vs 10.26%.
Another way to hedge is by flattening out deltas when a certain delta level is reached. There is a feature of the backtester called Hedge Tolerance that will buy or sell the underlying when the Minimum or Maximum tolerance is reached. Below, if the stock were to move down and the delta of the straddle goes below -0.20, 20 shares of stock would be purchased. If the stock were to go back up where the straddle had a positive 0.20 delta, 20 shares would be sold.
This strategy had a slightly better annual return but had a higher volatility since the hedging rule did not trade the underlying as often as the daily hedging.
Finally, a trader might want to blend the hedging strategies above, say a 50%/50% hedging/not hedging. Below, by selecting the check box next to the non-hedged and the hedged backtests and clicking 'Combine', the strategy of hedging each day can be combined in various weightings with a strategy of not hedging, here 50/50.
More reading on combining backtests HERE.
More on delta neutral strategies HERE.