Read the count
In the upward direction, 1 is counted each time price falls further below the low since the top. In the downward direction, new highs are counted.
Counts new lows after a top and new highs after a bottom, and switches the direction at the specified count. The height of a vertex is the extreme price, and the horizontal position is the bar that confirmed the turn.
Blue lineConnects confirmed tops and bottoms. The latest unconfirmed candidate is not drawn.
Red tops, green bottomsThe height is the held extreme, and the horizontal position is the bar that confirmed the turn.
What is counted is new extremesIt is neither an ordinary count of consecutive bars nor a window of the latest N bars.
Compares the default settings and a settings change example on a screen with only this product applied.
Example shown: M1. This is an example for explaining the display. The published images are screens from before the brand display was added. The calculation and drawing conditions are the same, and the packaged version has display settings for the brand text and the QR code. The settings change example is not a recommended value. Details can be checked in the full-size view. Please also check the price scale of the main chart and the positions of the candlesticks.
In the upward direction, 1 is counted each time price falls further below the low since the top. In the downward direction, new highs are counted.
On the bar where the specified count is reached, the held top or bottom price is drawn.
The colors and arrows are records of calculated turns. They also do not show that you could trade at that price.
Measures how many new extremes have accumulated in the opposite direction from a swing extreme. It does not measure price range, percentage of price or the probability of a future turn.
When a new top is made, the low reference is reset to that bar's low, and the count of new lows is set to 0. After that, each time price falls below the reference low, the reference and the count are updated.
When a new bottom is made, the high reference is reset to that bar's high, and the count of new highs is set to 0. After that, each time price rises above the reference high, it is counted.
The count remains even if there are bars without new extremes in between. Bars contained within the previous bar are skipped, and equal highs and lows are not counted as new extremes.
A bar that exceeds both the held swing high and swing low gives priority to extending the current direction. Merely engulfing the previous bar does not always mean an extension.
Check Swing Bars 2 and Closed Bars Only true.
The height of an arrow is the extreme price, and the horizontal position is the bar that confirmed the turn.
Tracks how many times the opposite-side reference was exceeded further since the previous extreme. Bars without a new extreme and equal values are not counted.
Change only Swing Bars on a separate chart. Check why the points increased or decreased and where the resets occurred.
| Included file | Purpose / location |
|---|---|
| TRI_Gann_Count_Swing.ex5 | The MT5 main file. Place it in MQL5/Indicators. |
The ZIP contains only 1 item, the main file. The manual is opened from the product page on the site. Source code is not included. MT5 only; registration, account authentication and placing a license file are not required. Use it without changing the file name.
Extract the ex5 main file rather than leaving it in the compressed file.
In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.
Refresh the Navigator or restart MT5, and apply it to the target chart. When comparing different settings, using separate charts makes checking easier.
First check with the default values. Changes and removal are done from the chart's 'Indicators List'.
Using this product does not require allowing DLLs. When removed, this product's drawings are cleared.
There are 6 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.
InpBarsInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYAt the start of the history there is no direction, and new highs and new lows are counted. The side that reaches the specified count first is chosen; if both reach the same count at the same time, it is upward. No dot is placed for this first direction decision.
When closed bars are added with the same history and settings, confirmed dots are not moved into the past. The next dot and segment are added later. Do not read that segment as having been visible from earlier.
Recalculates on settings changes, correction or additional loading of history, and changes of the start position. In these cases, the display is not guaranteed to stay unchanged.
Whether bars are bullish or bearish, the order in which prices are reached within a bar, and volume are not used as conditions for turns. There are no notification, order or file output functions.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
Deciding the initial direction alone does not produce a point. A turn is needed after that, and several confirmed points are needed to connect a line.
With true, the forming bar is not processed. Even with false, nothing appears unless the turn conditions are met.
Only new extremes in the opposite direction are counted. Bars without a new extreme in between are not counted, and a new extreme in the current direction resets the count to 0.
By design, the past extreme price is placed on the confirming bar. It does not necessarily match the confirming bar's own high or low.
Set Swing Bars to an integer from 1 to 10. Values outside the range are rejected at loading.
Adjust the price scale and the display range, and also check in the actual-size display.
If the first display does not appear, check history loading and the input ranges. If an earlier display has stopped updating, first check the price feed and the terminal's connection status.
Only a high greater than the held high, or a low smaller than the held low, is a new extreme. Bars whose high is at or below the previous bar's high and whose low is at or above the previous bar's low are skipped. Values equal to a boundary are not counted.
In the upward direction, a new high is processed first, the low reference is reset to that bar's value, and the new-low count is set to 0. In the downward direction, a new low is processed first. Even if both sides are exceeded, 1 bar does not reverse 2 times.
The zigzag points are connected with DRAW_SECTION, and tops and bottoms are output to separate arrows. Up to 1 confirmed point is output on 1 bar. Unconfirmed candidates are not drawn.
M1 is a label on the image. The price data is mainly at 30-minute intervals, and the image does not show how often marks appear on actual 1-minute bars.
The published images are screens from before the brand display was added. The on-screen display of the product with the brand display has not yet been verified.