Previously, I met several traders who experienced live results quite different from their backtest results. The reason was an apparent triviality – too little stop loss. Let me explain to you today why this can be a problem, what to be aware of and how to avoid this danger. The following topic is almost about the breakout strategies that use STOP order to open a position and at the same time they use too little stop loss (this article is not about strategies that use market order). What is the small stop loss? It depends on the market and the time frame. But overall, it’s a stop-loss smaller than the size of an average bar in our main timeframe. Let me give you an example – if we use a 30-minute chart with an average bar value of $ 250 and our strategy works with a stop loss of $ 80, we are heading into a serious problem. The live trading results can (and in most cases almost likely) be quite different from the ones we have from the baking test. Let’s look at the cause.
This problem occurs when the stop-loss is so small that some of the trades have an entry order and stop-loss on the same bar. Let’s say we have a post-STOP order of price 100 and also a stop-loss of price 99. Now imagine that the line opens at 98.7, it goes to 100.1 and we open the long one position – and stop-loss is set to 99. And all this happens within the same bar – ie. Within this one bar, the input order is activated, the position is opened and the stop loss is set.
Now it is important to understand why this could potentially be a dangerous problem. It’s quite simple. There are several backtesting platforms that are unable to recognize with the wrong setup or when the data resolution is not fine enough if the stop-loss was or was not hit at an entry bar. In other words, there are certain situations where the stop-loss was actually hit just after the opening of the position, because the market just after the entry of the entry order starts to the south. However, our backtesting platform evaluates the trade as a profitable platform (from now on I will write about TradeStation as it is a platform that I primarily use). How is it possible?
Let’s continue with the demonstration of the situation described above. In this situation we can see the rising beam, ie. the one that has a close price above the open price, and at the same time, it is close to its high. There is an assumption that the bar is constantly rising, and TradeStation assumes that the bar’s “inner” movement, ie. the way the bar was generated was constantly increasing, a straight line.
TradeStation simply follows the logic that as the bar closed close to its high, the process of generating that bar increased. In such a situation, TradeStation assumes that the bar opened in 98.7 and that the price continuously rose to 100.4. And during this period, it also activated our purchase order at the price of 100.
Nevertheless, this is a very inaccurate and dangerous assumption. What if the bar first rose activating our purchase order, but then it returned and went back, during our stop-loss and then started to rise again to get close to its high?
This is a completely realistic scenario that happens every single day and would result in a clear loss (right after we opened the position) – and yet TradeStation (and potentially other software) defines the situation as if there was no correction before in the line at all. So no stop loss was hit and trading ended up as a profitable one. This is the main cause of major problems, as you clearly see in the back test a lot of profitable trades that would in fact end up as a loss – and right after we start trading this strategy live, everything begins to fall apart …
Protection # 1
Fortunately, the situation is not as serious as it looks, and backtesting platforms generally take this risk into account.
The first protection against this threat is simple and to some degree very effective. TradeStation calls it LIBB (Look-Inside-Bar-Backtesting), others call it various names, like Bar Magnifier. The point is that when you turn this feature on, the program looks inside the bar to the level of the finest available data resolution (in most cases it is 1 minute) if there was no internal correction after the input order was activated or if there was a correction on the same beam as we entered and the stop-loss was hit.
While this sounds like a great solution (which is a standard part of most platforms today), it doesn’t have to be sufficient when it comes to small stop losses. Why? Imagine a situation where your stop loss is $ 80, but the average bar for your finest LIBB resolution (ie most 1 minute) is $ 150 big. In this case, you experience the same problem as described above when the platform is unable to determine if the stop loss inside the bar was hit or not, and again, just an inaccurate approach driven by the above- described logic – if the line closed closer to its low or closer to its high. In other words, you’re back in the beginning and with too little stop-loss, not even LIBB will help you, and the problem still persists.
Protection # 2
So we get to the point where we have to go a little deeper to solve this problem. One of the solutions would be to use even finer data resolution – down to the cross level. But this is not as easy as it sounds. First, the cross-data history is not as easily accessible or just for a very short period of time. And if that data is available, they are really expensive. But even if you are still buying cross data, you need to solve several technical issues – since the cross data is usually so large that most of the platforms do not handle as much data, crash or run backtests incredibly slowly (I can confirm this).
Protection # 3
So we have to use a much simpler solution – and that is the need to use a reasonably large stop-loss. And what’s a pretty big stop-loss? Simply use stop-losses that are at least 1.5-2x larger than the largest 1-minute bar on your chart. It’s simple and you can avoid more problems. For example, if the largest 1-minute bar for all your data history was $ 300, you would need to use at least $ 450 stop-loss. Period. It’s easier and safer to get used to bigger stop-losses than lying to ourselves and then being surprised why such a nice backtest equity is the opposite of the results of live trading.