Flags and pennants are continuation patterns. They are traded in the same way, but each has a slightly different shape. The terms flag and pennant are often used interchangeably.
A flag or pennant pattern forms when the price rallies sharply, then moves sideways or slightly to the downside. This sideways movement typically takes the form or a rectangle (flag) or a small triangle (pennant), hence their names. Draw trend lines along the highs and lows of the sideways price action. The sharp price rise preceding the flag or pennant is called the flag pole.