Is the Flag Pattern a Continuation Pattern? Let’s Check on History
22 December 2021In the following research, we will consider such a popular chart pattern as the Flag.
In his book “Technical Analysis of Futures Markets: Theory and Practice”, John J. Murphy characterizes this trend continuation pattern in the following way:
"The Flag pattern marks short pauses in a dynamically developing trend. The formation of this pattern on the chart should be preceded by a steep and almost straight line of price movement. This model denotes markets that, in their development up or down, seem to be overtaking themselves, and therefore must stop and rest for a while before continuing to move in the same direction."
The Flag pattern refers to trend continuation patterns. After the formation of a Flag, the market continues to move in the same direction.
A flag is a short-term consolidation of prices in a narrow range that forms within a trend movement, which is represented by a pattern bounded by parallel lines. It can be seen on the price chart of any financial instrument and on any timeframe.
A characteristic feature of the pattern, from which it got its name, is a noticeable vertical price movement ("flagpole") and then a sweeping horizontal movement - a "banner". The pattern forms its shape by filling the area of the pattern with candles.
There are two “Flag” types: bullish (formed on an uptrend) and bearish (formed on a downtrend) (Fig. 1).
We will test signals generated by the "Flag" patterns on a large amount of historical data of various financial instruments and in the context of two timeframes.
In addition, we are going to test the “Flag” in eight of its combinations, namely by adjusting the conditional parameters: the ATR coefficient, percentage of candles overlapping, and the number of candles in the “Flag” pattern. For convenience, let's call them ATR, PB, and F, respectively.
The Flags: with the above-mentioned parameters look like this (Fig. 2):
The figure shows the Flags formed on an uptrend, for a downtrend the situation is mirrored.
What do the given conditional parameters of the Flag mean?
- The ATR coefficient characterizes the length of the flagpole. The larger this coefficient, the longer the flagpole.
- The percentage of candlesticks overlapping characterizes the spread of candlesticks in the Flag banner. The higher the percentage of candlesticks overlapping is, the more the Flag banner resembles a rectangle.
- The number of candlesticks in the pattern characterizes the Flag's banner. The more candlesticks there are, the more sweeping the banner is.
Now let's discuss the conditions for opening and closing a trading position.
Conditions for opening a trading position:
After the pattern is formed, a position is opened at the open of the next candlestick:
On the bullish flag - buy;
On the bearish flag - sell.
Closing a position:
In all situations, the lifetime of a position is 5 or 10 candlesticks.
Next, we are going to define a list of financial instruments and their timeframes on which we will be testing the trading signal. This sample will be represented by:
- 23 currency pairs (Forex);
- 6 commodity futures (Commodities);
- 2 stock indices (Indices);
- 30 stocks that are part of the Dow30 (Stocks).
Timeframes used:
H1 (1 hour) – 5 years of history,
Daily (1 day) -10 years of history.
The sample is 2,124,495 observations.
Having defined all the conditions and setting the necessary parameters, let's start testing!
Analysis of the results
First, we are going to estimate the results by the size of the obtained sample.
For 1-hour timeframe (H1):
Type of financial instruments | Number of candlesticks | Number of events |
Forex | 994755 | 85248 |
Commodities | 191850 | 16634 |
Indices | 87600 | 7873 |
Stocks | 628011 | 28920 |
For daily timeframe (D1):
Type of financial instruments | Number of candlesticks | Number of events |
Forex | 83950 | 3989 |
Commodities | 21900 | 858 |
Indices | 7300 | 403 |
Stocks | 109129 | 3310 |
Total: 2,124,495 candlesticks, 147,235 events (Flag patterns).
Next, let's see what is the share of the Flag events:
Pattern parameter | Forex | Commodities | Indices | Stock | Average |
ATR, PB, F 2,30,3 | 3.38 | 3.66 | 4.12 | 1.95 | 3.28 |
ATR, PB, F 2,30,5 | 2.33 | 1.83 | 2.13 | 1.07 | 1.84 |
ATR, PB, F 2,50,3 | 1.46 | 1.49 | 1.68 | 0.81 | 1.36 |
ATR, PB, F 2,50,5 | 0.47 | 0.29 | 0.33 | 0.19 | 0.32 |
ATR, PB, F 4,30,3 | 0.28 | 0.38 | 0.25 | 0.09 | 0.25 |
ATR, PB, F 4,30,5 | 0.19 | 0.19 | 0.12 | 0.05 | 0.14 |
ATR, PB, F 4,50,3 | 0.11 | 0.14 | 0.08 | 0.03 | 0.09 |
ATR, PB, F 4,50,5 | 0.04 | 0.03 | 0.01 | 0.01 | 0.02 |
Based on the grouping results, we can conclude that regardless of the types of financial instruments, the distribution of Flags is approximately the same, namely:
- Flags with ATR, PB and F parameters: 2, 30 and 3 accounted for between 1.95% and 4.12% of the total number of candlesticks;
- Flags with ATR, PB and F parameters: 2, 30 and 5 accounted for between 1.07% and 2.33% of the total number of candlesticks;
- Flags with ATR, PB and F parameters: 2, 50 and 3 accounted for between 0.8%1 and 1.68% of the total number of candlesticks;
- Flags with ATR, PB and F parameters: 2, 50 and 5 accounted for between 0.19% and 0.47% of the total number of candlesticks;
- Flags with the ATR, PB and F parameters: 4, 30 and 3 accounted for between 0.09% and 0.38% of the total number of candlesticks;
- Flags with ATR, PB and F parameters: 4, 30 and 5 accounted for between 0.05% and 0.19% of the total number of candlesticks;
- Flags with the ATR, PB and F parameters: 4, 50 and 3 accounted for between 0.03% and 0.14% of the total number of candlesticks;
- Flags with ATR, PB and F parameters: 4, 50 and 5 accounted for between 0.01% and 0.04% of the total number of candlesticks.
Also note that the more pronounced the Flag pattern is, the less its share in the total number of candlesticks is.
Now let's consider the results of processing the trading signals obtained as a result of the formed Flags.
We are going to evaluate the results according to two criteria:
- Momentum (m) - reflects the average percentage of increment of quotations of financial instruments at the moment of closing positions, in %. A positive momentum value indicates the profitability of signal processing; a negative momentum value indicates a loss.
- SPP - share of profitable positions, %.
Momentum in % and share of profitable positions in % in the context of holding positions, timeframes and Flag parameters:
Indicator | 5th candlestick | 10th candlestick | H1 | D1 | ATR 2 | ATR 4 | PB 30 | PB 50 | F3 | F5 |
m | 0.06 | 0.11 | 0.01 | 0.15 | -0.03 | 0.2 | 0.02 | 0.15 | 0.14 | 0.03 |
SPP | 45.1 | 45.4 | 47.4 | 43.2 | 48.7 | 41.8 | 47.4 | 43.2 | 48.5 | 42.1 |
Momentum in % and share of profitable positions in % by types of financial instruments:
Indicator | Forex | Commodities | Indices | Stock |
m | 0.02 | -0.19 | 0.09 | 0.18 |
SPP | 47.9 | 42.3 | 55.4 | 43.2 |
12 out of 14 average Momentum values for the parameters are positive.
At the same time, some features can be highlighted.
To do this, let us visualize the results in the form of Momentum distribution (m) relative to each parameter considered (position closing candlestick, timeframe, Flag parameter, type of financial instruments).
The diagrams above show the momentum distribution depending on the parameters under consideration. Each diagram consists of two parts: "box" and "tails" (or "whiskers"). 50% of the observed values are placed in the “box”, the remaining 50 are represented by “tails”. The end of the lower “tail” represents the smallest observed value, and the end of the upper “tail” represents the largest one. The cross shows the average value.
Analysis of the results allows us to draw the following preliminary conclusions:
- the average value of the Momentum when closing positions on the 10th candlestick is located higher than the average value of closing on the 5th one, which indicates a higher profitability of closing positions on the 10th candlestick;
- the average value of the Momentum on the daily timeframe is located higher than on the hourly one, which indicates a higher profitability of working on a signal on daily charts;
- the best Momentum (in comparison with the others) is noted with the following Flag parameters: the ATR coefficient is at least 4, candlesticks overlapping is at least 50%, and the number of candlesticks in the pattern is at least 3.
- the greatest Momentum among financial instruments is observed in the Stocks.
Let's look at the results in the context of the timing of holding positions, timeframes, the Flag pattern parameters (the ATR coefficient, percentage of candlestick overlapping, the number of candlesticks in the pattern) and types of financial instruments.
Let's accept the conventions:
"H1/5" - closing a position on the 5th candlestick when working on 1-hour timeframe;
"H1/10" - closing a position on the 10th candlestick when working on 1-hour timeframe;
"D1/5" - closing a position on the 5th candlestick when working on daily timeframe;
"D1/10" - closing a position on the 10th candlestick when working on daily timeframe;
SPP - share of profitable positions, %,
ATR - ATR ratio;
PB - percentage of candlesticks overlapping, %;
F - number of candlesticks in the Flag pattern.
The obtained sample sizes, Momentum values and shares of profitable positions for hourly charts when closing positions on the 5th candlestick:
Н1/5 | ||||||
Flag parameters | Indicator | Stocks | Indices | Commodities | Forex | All |
ATR,PB,F 2,30,3 | Momentum | -0.088 | -0.010 | 0.026 | 0.002 | -0.018 |
SPP | 48.8 | 47.7 | 47.9 | 49.0 | 48.8 | |
Number of patterns | 13407 | 3717 | 7544 | 34792 | 59460 | |
ATR,PB,F 2,30,5 | Momentum | -0.087 | -0.002 | 0.028 | -0.0001 | -0.015 |
SPP | 48.9 | 48.9 | 48.3 | 48.7 | 48.8 | |
Number of patterns | 7407 | 1908 | 3882 | 24104 | 37301 | |
ATR,PB,F 2,50,3 | Momentum | -0.077 | 0.006 | 0.035 | -0.0001 | -0.009 |
SPP | 47.9 | 49.5 | 48.5 | 48.5 | 48.2 | |
Number of patterns | 5568 | 1527 | 2966 | 15065 | 25126 | |
ATR,PB,F 2,50,5 | Momentum | -0.020 | -0.0005 | -0.003 | -0.007 | -0.008 |
SPP | 46.5 | 48.6 | 46.8 | 47.7 | 47.1 | |
Number of patterns | 1302 | 303 | 571 | 4840 | 7016 | |
ATR,PB,F 4,30,3 | Momentum | 0.211 | -0.016 | 0.027 | 0.002 | 0.056 |
SPP | 51.2 | 48.3 | 49.7 | 49.4 | 50.3 | |
Number of patterns | 620 | 224 | 853 | 2917 | 4614 | |
ATR,PB,F 4,30,5 | Momentum | -0.220 | 0.000 | 0.017 | -0.008 | -0.053 |
SPP | 43.0 | 50.5 | 50.9 | 49.5 | 46.5 | |
Number of patterns | 334 | 108 | 450 | 1954 | 2846 | |
ATR,PB,F 4,50,3 | Momentum | 0.052 | -0.047 | 0.212 | -0.008 | 0.052 |
SPP | 50.3 | 45.5 | 53.5 | 48.1 | 49.6 | |
Number of patterns | 237 | 75 | 308 | 1192 | 1812 | |
ATR,PB,F 4,50,5 | Momentum | 0.334 | 0.020 | 0.342 | 0.003 | 0.175 |
SPP | 32.5 | 55.0 | 48.9 | 50.4 | 41.6 | |
Number of patterns | 45 | 11 | 60 | 384 | 50 |
The obtained sample volumes, Momentum values and shares of profitable positions for hourly charts when closing positions on the 10th candlestick:
Н1/10 | ||||||
Flag parameters | Indicator | Stocks | Indices | Commodities | Forex | All |
ATR,PB,F 2,30,3 | Momentum | -0.051 | 0.002 | 0.048 | -0.0002 | -0.0004 |
SPP | 49.2 | 48.6 | 49.8 | 49.0 | 49.2 | |
Number of patterns | 13404 | 3714 | 7543 | 34790 | 59451 | |
ATR,PB,F 2,30,5 | Momentum | -0.097 | 0.023 | 0.084 | -0.0050 | 0.001 |
SPP | 49.3 | 50.4 | 50.8 | 48.9 | 49.3 | |
Number of patterns | 7406 | 1905 | 3881 | 24102 | 37294 | |
ATR,PB,F 2,50,3 | Momentum | -0.071 | 0.013 | 0.093 | 0.0005 | 0.009 |
SPP | 48.7 | 50.3 | 50.0 | 49.1 | 49.0 | |
Number of patterns | 5568 | 1527 | 2964 | 15063 | 25122 | |
ATR,PB,F 2,50,5 | Momentum | -0.211 | 0.0225 | 0.127 | -0.019 | -0.020 |
SPP | 48.5 | 53.7 | 50.9 | 48.4 | 48.9 | |
Number of patterns | 1302 | 303 | 570 | 4838 | 7013 | |
ATR,PB,F 4,30,3 | Momentum | 0.351 | -0.057 | 0.118 | 0.002 | 0.103 |
SPP | 51.0 | 55.0 | 49.0 | 49.6 | 50.4 | |
Number of patterns | 620 | 224 | 852 | 2917 | 4613 | |
ATR,PB,F 4,30,5 | Momentum | -0.049 | 0.009 | 0.227 | -0.017 | 0.043 |
SPP | 43.1 | 58.0 | 52.3 | 49.7 | 47.0 | |
Number of patterns | 334 | 108 | 449 | 1954 | 2845 | |
ATR,PB,F 4,50,3 | Momentum | -0.080 | -0.127 | 0.410 | -0.023 | 0.045 |
SPP | 42.6 | 50.7 | 52.5 | 48.8 | 46.2 | |
Number of patterns | 237 | 75 | 308 | 1192 | 1812 | |
ATR,PB,F 4,50,5 | Momentum | 0.114 | 0.100 | 0.893 | -0.085 | 0.256 |
SPP | 24.2 | 63.3 | 64.3 | 46.5 | 37.8 | |
Number of patterns | 45 | 11 | 60 | 384 | 500 |
The obtained sample sizes, Momentum values and shares of profitable positions for daily charts when closing positions on the 5th candlestick:
D1/5 | ||||||
Flag parameters | Indicator | Stocks | Indices | Commodities | Forex | All |
ATR,PB,F 2,30,3 | Momentum | -0.094 | -0.215 | -0.191 | -0.140 | -0.160 |
SPP | 49.4 | 48.8 | 48.5 | 47.6 | 48.6 | |
Number of patterns | 1536 | 195 | 397 | 1776 | 3904 | |
ATR,PB,F 2,30,5 | Momentum | -0.103 | -0.318 | 0.073 | -0.096 | -0.111 |
SPP | 49.2 | 47.0 | 49.3 | 47.9 | 48.6 | |
Number of patterns | 798 | 112 | 226 | 1087 | 2223 | |
ATR,PB,F 2,50,3 | Momentum | 0.162 | -0.278 | -0.470 | -0.343 | -0.233 |
SPP | 54.6 | 47.8 | 43.3 | 42.9 | 48.9 | |
Number of patterns | 652 | 65 | 172 | 681 | 1570 | |
ATR,PB,F 2,50,5 | Momentum | 1.072 | 0.043 | -0.410 | -0.251 | 0.114 |
SPP | 53.9 | 64.3 | 44.9 | 47.0 | 50.8 | |
Number of patterns | 159 | 14 | 33 | 201 | 407 | |
ATR,PB,F 4,30,3 | Momentum | 1.200 | 1.097 | -2.395 | 0.012 | -0.022 |
SPP | 52.9 | 80.0 | 32.8 | 47.6 | 49.8 | |
Number of patterns | 87 | 9 | 16 | 110 | 222 | |
ATR,PB,F 4,30,5 | Momentum | -0.233 | 0.504 | -1.243 | 0.131 | -0.210 |
SPP | 20.0 | 83.3 | 36.1 | 48.6 | 34.4 | |
Number of patterns | 45 | 5 | 9 | 74 | 133 | |
ATR,PB,F 4,50,3 | Momentum | 0.847 | 2.348 | -0.964 | 0.168 | 0.599 |
SPP | 42.2 | 100.0 | 25.0 | 41.7 | 42.2 | |
Number of patterns | 29 | 2 | 5 | 44 | 80 | |
ATR,PB,F 4,50,5 | Momentum | 0.279 | 0.166 | 0.000 | -0.106 | 0.085 |
SPP | 10.0 | 50.0 | 0.0 | 30.4 | 18.0 | |
Number of patterns | 4 | 1 | 0 | 16 | 21 |
The obtained sample sizes, Momentum values and shares of profitable positions for daily charts when closing positions on the 10th candlestick:
D1/10 | ||||||
Flag parameters | Indicator | Stocks | Indices | Commodities | Forex | All |
ATR,PB,F 2,30,3 | Momentum | -0.048 | -0.512 | -0.310 | -0.017 | -0.222 |
SPP | 48.6 | 46.3 | 48.0 | 50.3 | 49.1 | |
Number of patterns | 1534 | 195 | 391 | 1776 | 3896 | |
ATR,PB,F 2,30,5 | Momentum | -0.169 | -0.839 | -0.140 | 0.078 | -0.268 |
SPP | 47.3 | 41.6 | 50.1 | 51.6 | 49.0 | |
Number of patterns | 797 | 112 | 223 | 1087 | 2219 | |
ATR,PB,F 2,50,3 | Momentum | -0.043 | -0.203 | -0.016 | -0.390 | -0.163 |
SPP | 49.4 | 46.1 | 47.5 | 44.9 | 47.4 | |
Number of patterns | 652 | 65 | 168 | 681 | 1566 | |
ATR,PB,F 2,50,5 | Momentum | 0.263 | 0.907 | -0.682 | -0.011 | 0.119 |
SPP | 45.7 | 57.1 | 53.0 | 49.8 | 48.3 | |
Number of patterns | 159 | 14 | 32 | 201 | 406 | |
ATR,PB,F 4,30,3 | Momentum | 1.262 | -0.629 | -1.078 | 0.128 | -0.079 |
SPP | 60.4 | 45.0 | 26.1 | 49.9 | 52.6 | |
Number of patterns | 87 | 9 | 16 | 110 | 222 | |
ATR,PB,F 4,30,5 | Momentum | -0.256 | -0.273 | -0.580 | 0.263 | -0.212 |
SPP | 28.3 | 41.7 | 27.8 | 48.8 | 36.4 | |
Number of patterns | 45 | 5 | 9 | 74 | 133 | |
ATR,PB,F 4,50,3 | Momentum | 1.666 | 0.776 | -0.401 | 0.836 | 0.719 |
SPP | 38.9 | 100.0 | 8.3 | 58.4 | 45.2 | |
Number of patterns | 29 | 2 | 5 | 44 | 80 | |
ATR,PB,F 4,50,5 | Momentum | 0.101 | 0.262 | 0.000 | 0.657 | 0.255 |
SPP | 6.7 | 50.0 | 0.0 | 43.5 | 21.3 | |
Number of patterns | 4 | 1 | 0 | 16 | 21 |
Let's summarize the results obtained using the diagrams:
The results obtained allow us to draw the following conclusions.
The largest Momentum of 0.719% is shown by the signals generated by the Flag pattern on the daily timeframe, with the following Flag parameters: the ATR coefficient is at least 4, the percentage of candlesticks overlapping is at least 50, the number of candlesticks in the pattern is at least 3 and when fixing a position on the 10th candlestick.
There is a tendency that as the ATR coefficient grows, the Momentum grows, similarly to the percentage of candlesticks overlapping. This suggests that the trading signals received by a more pronounced Flag pattern (a longer flagpole and a rectangular banner) have a greater positive strength.
However, the Momentum from the signal of the Flag pattern is small, so this signal can be considered ineffective.
Summing up, we can conclude that the signal according to the generally accepted interpretation of the considered Flag pattern does not bring profit.
The influence of the Flag pattern on the market has not been revealed.
The detailed results are presented in the appendix:
Comments
4