MT5 indicators← MA Cross ZigZag product page日本語の取扱説明書

This product is in preparation for release. Product files are not yet distributed; the manual is published so that you can review its content. This manual is an English translation of the Japanese manual. Images (screens and figures) are not translated and may contain Japanese text or earlier names.

For Trilogy users

MA Cross ZigZag

From the up/down relation of the fast and slow averages on the previous bar, it confirms the tops and bottoms of segments. The height of the mark is the extreme price, and the horizontal position is the confirming bar.

Indicator name: MA Cross ZigZagMetaTrader 5Price chart

MA order on the previous bar → extreme of the segment confirmed → mark placed on the confirming bar

Previous topPast low priceBottom confirmed on the next barPrevious bar: fast average above
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Orange and purple are moving averagesOrange is the Fast MA and purple the Slow MA. The lines show each bar's value, and the check uses the value 1 bar earlier.

2

Red is a top, green is a bottomWhen the up/down relation of the averages differs from the held direction, the high or low of the segment is confirmed. The blue line connects the confirmed points.

3

Separate height and horizontal positionThe mark is not drawn back on the bar of the past extreme. The height is the extreme price, and the horizontal position is the bar on which the condition was confirmed.

Slow 14 / Fast 3, SMMAThe check uses the previous bar's MABy default, marks on closed barsMT5, no account authentication
1

MT5 display and examples of changed settings

Compares the default settings and a settings change example on a screen with only this product applied.

Settings change example: these items are changed
Slow-side period / Slow MA Period (1 to 1000)
InpSlowPeriod
14 → 20
Slow-side calculation method / Slow MA Method
InpSlowMethod
SMMA → SMA
Slow-side price used / Slow MA Price
InpSlowPrice
Close → Median
Fast-side period / Fast MA Period (1 to 1000)
InpFastPeriod
3 → 1
Fast-side calculation method / Fast MA Method
InpFastMethod
SMMA → SMA
Check points on closed bars / Closed Bars Only
InpClosedBarsOnly
true → false

All other inputs remain at their defaults. On a PC, the default is on the left and the change example on the right; at smartphone width they appear in the same order from top to bottom.

Default settingsInpSlowPeriod = 14 / InpSlowMethod = SMMA / InpSlowPrice = Close / InpFastPeriod = 3 / InpFastMethod = SMMA / InpClosedBarsOnly = true
MA Cross ZigZag default settings
Defaults: Slow 14, SMMA, Close; Fast 3, SMMA, Close; Closed Bars Only true. Purple and orange MAs, red tops, green bottoms and a blue zigzag. Some marks are near the top and bottom edges.
View the screen in detail at full size
MA Cross ZigZag default settings (full size)
Settings change exampleInpSlowPeriod = 20 / InpSlowMethod = SMA / InpSlowPrice = Median / InpFastPeriod = 1 / InpFastMethod = SMA / InpClosedBarsOnly = false
MA Cross ZigZag settings change example
Change example: Slow 20, SMA, Median; Fast 1, SMA, Close; Closed Bars Only false. This example changes 6 items at the same time. The fast average is the close itself, so it overlaps the candles and is hard to see.
View the screen in detail at full size
MA Cross ZigZag settings change example (full size)

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.

2

How to read it in 30 seconds

Distinguish the averages from the zigzag

Purple and orange are moving averages. Blue is the line connecting the confirmed tops and bottoms.

Look 1 bar before the mark

If Fast is above Slow on the previous bar, it is a bottom candidate; if below, a top candidate. Marks are not added while the same direction continues.

Read the time of confirmation

By default, the mark is confirmed only after the bar following the bar where the MAs were compared has also closed. The high and low of that bar are also included in the search.

3

What it measures

An indicator that uses changes in the order of moving averages to confirm the extremes of segments afterward. It does not predict when tops and bottoms occur or future reversals.

2 moving averages

Specify the period, calculation method and price used for each. SMA, EMA, SMMA and LWMA can be selected, and the 2 lines can use different methods and prices.

Switching direction

If Fast is above Slow on the previous bar and the held direction is not up, a bottom is confirmed. If below and the held direction is not down, a top is confirmed. If they are equal, the earlier direction is kept.

First mark

At first there is no direction. A mark is drawn even when the up/down relation is set for the first time after the calculation starts. The first mark is not evidence that a cross before that was observed.

Extreme search segment

It searches from the bar after the bar with the previously adopted opposite-side extreme, including the current confirming bar. The search does not start from the bar where the previous mark was shown.

Equal highs and lows

If there are several equal lowest lows or highest highs, the newer bar is chosen. That bar also affects the start position of the next search.

Price of the point

A bottom is the Low of the segment, a top the High. Changing MA Price to Close or Median does not make the mark price come from the close or the median price.

4

Situations for reading the display

A green trough appeared

Indicator
On the previous bar, Fast was above Slow, and the direction switched to up.
Cross-check
Look at the previous bar's MAs and the low of the confirmed segment separately.
Check
The horizontal position of the mark is the confirming bar, and the height is the lowest low of the segment, which includes the past.
Caution
It does not guarantee that you can buy at that price or that a rise follows.

A red peak appeared

Indicator
On the previous bar, Fast was below Slow, and the direction switched to down.
Cross-check
Cross-check the highs after the previous bottom extreme with the confirming bar.
Check
Use the confirmation of the top to organize the price movement.
Caution
It is not a sell instruction or a forecast of a fall.

The lines crossed but there is no mark

Indicator
It compares the MAs of the previous bar, not of the current bar. By default, the next check bar must also close.
Cross-check
Separate the bar where the lines crossed from the check bar 1 bar later.
Check
Also check that equality does not change the direction.
Caution
It does not draw a mark at every touch on the chart.

The lines became the same

Indicator
While the MA values are equal, the direction and the last extreme are kept.
Cross-check
Check whether the 2 lines have the same period, method and price.
Check
With the same settings, the 2 lines overlap, and it is normal that no point appears.
Caution
The name Fast alone does not mean it always reacts faster.

More points in the change example

Indicator
The change example changes the period, method, price and handling of the latest bar at the same time.
Cross-check
Comparing 1 item at a time on the same history lets you separate the effects.
Check
Check the density of points and the delay of confirmation relative to price.
Caution
This example is not a recommended setting, nor a rule that the number of points always increases.
5

Steps for checking the display

1

Apply with the defaults

Check Slow 14, Fast 3, both SMMA and Close, Closed Bars Only true.

2

Prepare the required history

Checks start from bar (larger period + 1), counting the oldest as bar 1. The default is bar 15. With closed bars only, that bar must also be closed.

3

Separate the previous bar from the confirming bar

The up/down relation of the MAs is from the previous bar, and the extreme search range runs up to the confirming bar. Do not read the mark price as fixed right after the previous bar closed.

4

Separate confirmed points from added line segments

A blue line segment is added after a new point appears. The whole diagonal line in the finished picture was not visible from a time partway through it.

6

Installation and checking the package contents

Included filePurpose / location
TRI_MA_Cross_ZigZag.ex5The 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.

1

Extract the ZIP

Extract the ex5 main file rather than leaving it in the compressed file.

2

Open the data folder

In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.

3

Apply this product

Refresh the Navigator or restart MT5, and apply it to the target chart. When comparing different settings, using separate charts makes checking easier.

4

Check the settings and display

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.

7

Settings

There are 11 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.

Slow-side period

English item name
Slow MA Period (1 to 1000)
Input name
InpSlowPeriod
Default
14
Allowed range
Integer 1 to 1000
Description
Default 14. It does not need to be longer than the Fast side, and the same period can also be entered.

Slow-side calculation method

English item name
Slow MA Method
Input name
InpSlowMethod
Default
SMMA
Allowed range
SMA / EMA / SMMA / LWMA
Description
Default SMMA. 4 types: simple, exponential, smoothed and linear weighted.

Slow-side price used

English item name
Slow MA Price
Input name
InpSlowPrice
Default
Close
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
Default Close. The price used to calculate the purple line.

Fast-side period

English item name
Fast MA Period (1 to 1000)
Input name
InpFastPeriod
Default
3
Allowed range
Integer 1 to 1000
Description
Default 3. It is not forced to be shorter than the Slow side. With period 1, it is the selected price itself.

Fast-side calculation method

English item name
Fast MA Method
Input name
InpFastMethod
Default
SMMA
Allowed range
SMA / EMA / SMMA / LWMA
Description
Default SMMA. It can be selected separately from the Slow side.

Fast-side price used

English item name
Fast MA Price
Input name
InpFastPrice
Default
Close
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
Default Close. The price used to calculate the orange line. The search for marks always uses High and Low.

Check points on closed bars

English item name
Closed Bars Only
Input name
InpClosedBarsOnly
Default
true
Allowed range
true / false
Description
Default true. On the latest forming bar, points are not checked, but the 2 MAs are updated. With false, the mark price also changes with the high and low of the latest bar.

Brand display and QR

English item name
Show Trilogy brand and QR code
Input name
InpTriBrandShow
Default
true
Allowed range
true / false
Description
Switches the brand text and QR display on or off.

Brand display position

English item name
Brand position (chart corner)
Input name
InpTriBrandCorner
Default
Bottom left
Allowed range
Top left / Bottom left / Top right / Bottom right
Description
Choose from the four corners of the chart.

Brand horizontal offset

English item name
Brand horizontal offset (pixels)
Input name
InpTriBrandX
Default
10
Allowed range
Integer. Limited to 0 to 2000
Description
Adjusts the horizontal margin from the specified corner, in pixels.

Brand vertical offset

English item name
Brand vertical offset (pixels)
Input name
InpTriBrandY
Default
10
Allowed range
Integer. Limited to 0 to 2000
Description
Adjusts the vertical margin from the specified corner, in pixels.
8

Usage specifications

Confirmed dots

When bars are added with the same history and settings, dots on closed bars are not moved to the bar of a past extreme. Settings changes, adding older history or corrections may change recalculated results.

Latest display

Even with Closed Bars Only true, the latest MA value updates. With false, the high and low of the confirming bar also move, so the price of a mark also changes until it is confirmed.

Mark positions

A mark may be away from the range of the confirming bar. Because it is the extreme price of a range that includes the past, it does not mean an execution or a tradable price on that bar.

Adding segments

The blue line connects 2 confirmation points. Without the next point, it is not extended toward an intermediate candidate.

Functions not included

There is no MA Shift input, no notifications, no orders, no license file and no account authentication.

For on-screen display only

The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.

9

Troubleshooting and usage notes

Only the MAs appear, with no points

Check the required history, the settings of the 2 lines, and their up/down relation. With the same settings, the values are equal and no point appears. A blue line segment needs 2 points.

Fast looks slower than Slow

The names are the names of the input groups. A larger period or a different method or price can be set for Fast.

The lines move on the forming bar

Closed Bars Only limits the point check to closed bars. It is not a setting that fixes the MAs.

No cross before the first mark

In the first check, when there is no direction, a mark is placed even when the up/down relation is set for the first time.

Inputs are not accepted

Choose both periods as integers from 1 to 1000, the method from 4 types, and the price from 7 types.

Lines and marks are hard to see

An MA with period 1 and Close overlaps the candles. Adjust the chart scale and display range, and also check the published images at full size.

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.

10

Technical information and specification details

Initial value of the moving averages

EMA starts from the oldest price. SMA and LWMA start once prices for the period are available, and SMMA starts from the first simple average, after which it is (previous value × (period − 1) + current price) ÷ period. A match with MT4's initial values is not guaranteed.

Price definitions

Median=(High+Low)/2, Typical=(High+Low+Close)/3, Weighted=(High+Low+2×Close)/4.

Start of checks

Counting the oldest as 0, s0=max(SlowPeriod,FastPeriod). Even if the EMA is drawn earlier, the direction check starts from s0. The first search segment also starts from s0.

Up/down relation and equality

A bottom is confirmed when Fast[t−1]>Slow[t−1] and the direction is not up, and a top in the reverse case. It is not a 2-bar crossover formula; it looks at the difference from the held direction. While the values are equal, the direction is kept.

Time and search

It examines from the bar after the bar with the extreme up to the confirming bar t, and for equal values takes the newer bar. The output is at t. By default, the check is made after the close of t is final (usually when the next bar is received).

Published images and scope verified

M1 is the timeframe shown when the display example was created, and the price series is mainly at 30-minute intervals. It is not the frequency of appearance on actual 1-minute bars. The published images are screens before the brand display was added; the screen display on the product with the brand display has not been checked yet.