Saturday, February 28, 2009

Stop Loss Optimization

Recently I've started to explore different modifications to improve the performance of a trading strategy.  What follows is analysis on the implementation of stop losses.


Strategies are run one a minimum order size of 100 shares, using 1-minute bars, with no slippage or commission deducted.  This is because I have read that developing and optimizing while including slippage and commission will result in a suboptimal algorithm.  It is displayed here on one stock, but in reality testing was performed across 20 stocks for 10 trading days.  

This optimization is through a stop-loss order, where it does not move based on market activity.   Above you see the effect of a stop price implemented at position opening on one stock, with trades sorted by gross profit.  The "Gross" series is the unaltered strategy, and the "Difference in Gross Profit" series is the gross profit adjustment that the price stops place on the strategy. For example, at the extreme right side, you see that the stop loss "turned" an $0.80 per share trade profit into a per share loss of $0.05. 

Implementing Stop LossesPNL Effect
Lost Profit-245
Gross losses modified450
Realized Loss-256
Total-51

Stop losses turned $450 of gross losses into $256, saving $194.  However they also reduced profit on trades that won before by $245.  This nets out to -$51 employing the strategy over 10 days.  There were 168 total trades in the strategy during the test period.  Stop losses were activated in 63 of them, since the stop losses applied were extremely tight.  Slippage was added as $0.01 per activation, and if it is theoretically reduced to 0, then these stop losses resulted in a net gain to the strategy.  Lastly, it is interesting to note that stop losses affected 53 losing trades and 10 winning trades, possibly demonstrating that most of the good trades do not go out of the money too much.

Conclusion

Stop losses are a strong way to control downside losses and reduce PNL volatility.  However, along with this reduction there is a potential to miss a profitable position.  Additionally, stop losses without additional qualifications to open a new position will result in the algorithm reentering quickly.  Overall, stop losses reduced the magnitude of average losses, while increasing the frequency of losses.

This was the first algorithmic test of implementing stop losses, and the decrease in downside volatility is encouraging.  Perhaps with variable stops the lost profit can be regained, and also with more reliable reentry conditions the strategy will not encounter as many sequential losses, further exploration into this will be done.  I will not proceed by modifying the magnitude of the stop price, as that will likely be ineffective in addressing the above optimization weaknesses, rather I will explore other forms of criteria such as magnitude of trend or volume upon entry. 

Note that previous performance of the strategy on this stock was 2nd to worst across 20 stocks.  

Beginning Performance
Modified Performance
Sphere: Related Content

0 comments:

Post a Comment