Channel breakout

The figure below shows a typical breakout from a channel:


(General Electric in 2015, Source: NinjaTrader)

Backtesting of this type of trading strategy is rather subjective because the exits are not really defined here. In a discretionary trading , we may predict a potential take-profit level by e.g. sketching other trendlines. In other words, it is not enough to limit our analysis only to the channel. This may be a bit tricky when using automated trading.

Nevertheless, the objective of backtesting is just to check whether the action is really bullish and to estimate the performance of the strategy. Finally, the code can be used for creating of daily signals that can be used later for trading. I introduced some rules shown in the following.

The stop-loss was placed a few cents below the lowest low of the channel (see the figure above). The take profit was simply calculated by adding the distance between the breakout price and the stop-loss to the breakout price (see the distance h in the figure above).

I analysed S&P 500 stocks in the period 1 January 2000 – 31 December 2017 for stocks priced 20 – 90 USD. As soon as the program detects the daily closing price to be above the breakout line, the stock is bought on the next day on open.

My program detected 1376 entries as shown in the table below. Please note that this was done by software, not manually, so that some errors may occur (e.g. a detected channel may not be properly defined etc). Nevertheless, still the statistical results should show the performance.

Here are the results:

Profit factor 1.26
Max. drawdown -16.31%
Number of trades 1376
Percent profitable 58.87%
Average trade 1.69%
Ratio win/loss 0.90
Average time in market 64 days

The results are positive but not outstanding yet, e.g the maximum drawdown is rather large. Also, the percentage of profitable trades and the ratio/win loss ratio are rather average.

Nevertheless, the results can be improved by investigating the bullish action just before or on the breakout. At first, let us select trades where there was a bullish candle at the breakout. It is defined as a candle with very short shadows, i.e. the low of the day was almost the same as the opening price and the high of the day was almost the same as the closing price. Actually, this case is shown in figure above.

Here are the results:

Profit factor 1.43
Max. drawdown -5.72%
Number of trades 223
Percent profitable 57.85%
Average trade 1.70%
Ratio win/loss 1.03
Average time in market 64 days

Note that the percent of profitable trades is greater than 50% and at the same time, the win/loss ratio is greater than 1.0. In addition, the maximum drawdown has significantly improved. This indicates that this new strategy outperforms the standard one.

There are also other possibilities. For instance, we can enter a trade only after three higher closes, i.e. the closing price of today (which is also the breakout day) is greater than the closing price of yesterday and this is greater than the closing price of the day before yesterday. These are the results that again outperform the standard entry:

Profit factor 1.35
Max. drawdown -9.20%
Number of trades 517
Percent profitable 59.19%
Average trade 1.76%
Ratio win/loss 0.93
Average time in market 66 days

Finally, in real trading we can also consider other factors such as chart patterns or candlesticks that occur simultaneously. Therefore, the real performance of this strategy may be much better for an experienced trader.