In the context of technical analysis, a flag is a price pattern that, in a shorter time frame, moves counter to the prevailing price trend observed in a longer time frame on a price chart. It is named because of the way it reminds the viewer of a flag on a flagpole.
The flag pattern is used to identify the possible continuation of a previous trend from a point at which price has drifted against that same trend. Should the trend resume, the price increase could be rapid, making the timing of a trade advantageous by noticing the flag pattern.