User Guide – Pennant/Flag, Channel/Rectangle Indicator for Metatrader
The following user guide is for the Metatrader Pennant/Flag Indicator.
Quick Start
Start Metatrader and place the indicator onto the required chart. Enter the activation code into the panel. The settings can be refined depending on your chart period and the market you are trading.

Pattern detection is CPU intensive so to reduce processing time the detector will only examine the number of bars set in the “Max. history bars” setting. You can change this to a higher or lower value.
Input Settings
Input setting | Description |
---|---|
Maximum shape size (bars) | The minimum width in bars of the pennant/flag shapes | Sensitivity | Between zero and one. Increase for more patterns. |
Pattern type | Choose either flags, pennants, channels (rectangles) or any |
Show support/resistance lines | If yes, related support and resistance lines will be shown |
S/R threshold | Set a threshold for hiding support and resistance lines (zero shows all) | Fill patterns with color | Yes to display block shapes, no for outlines |
Pennant color | Color setting |
Flag color | Color setting |
Channel color | Color setting |
Mid line color | Color setting |
Text color | Color setting |
Max. history bars (zero for all) | How many bars to process (to limit processing time) |
Processing mode | Normal=1 Approximate=5 (use on slower computers) |
Use the “pattern type” option to select between either flags, pennants or both. By default the indicator will detect both pattern types.
The settings are application and chart dependent. To produce “higher quality” but few shapes, reduce the tolerance setting and the outlier setting. To produce higher numbers of shapes, these settings can be dialled up, although this may result in some false detections.

Indicator Outputs
The indicator generates numerical outputs on each detection and these will help analyze the shape better. The pattern type, the flagpole size, the depth and orientation of the shape are all output on each detection. The flagpole size is the distance (in chart points) from the shape’s mid line to the low/high price trailing the shape. The trail distance is controlled by the “Pole max distance” setting. The height of the flagpole can also be used as a filter. This is set as a percentage of the pennant/flag depth – which is the height from highest to lowest corner

Open Metatrader’s data window (CTRL+D) to show the signal values. You can hover with the mouse cursor over any point to display the value in the data window.
The table below lists the output signals.
Signal/Mode | Name | Description | Free version | License Version |
---|---|---|---|---|
0 | Pattern Type | 6=pennant, 7=flag, 8=rectangle, 10=channel | 1 | Flagpole | Price level of the flagpole |
2 | Depth | The pattern depth (high corner to low corner) in chart points | ||
3 | Orientation | The mid line angle of the pattern in radians |
Return to the pennant/flag indicator product page.