MT5 indicators← EMA Cross SAR Flip Marks 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

EMA Cross SAR Flip Marks

Shows a cross of 2 EMAs with a box, a cross of SAR and the Slow EMA with a dot, and an up/down flip of SAR with an arrow. Dots and arrows have a wait count, and arrows have an upper limit on the cumulative bar count on the side before the flip.

Indicator name: EMA Cross SAR Flip MarksMetaTrader 5Main chart

Read the 3 kinds of marks separately

1Box: cross of the 2 EMAs2Dot: cross of SAR and the Slow EMA3Arrow: conditional SAR flip
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Box: cross of the 2 EMAsA blue box marks a bar where the Fast EMA moved above the Slow EMA, a red box one where it moved below. The box is placed at the Fast EMA value.

2

Dot: cross of SAR and the Slow EMALight blue marks a bar where SAR moved to at or above the Slow EMA, purple one where it moved to at or below. No dot is placed on a SAR flip bar.

3

Arrow: conditional SAR flipWhen SAR moves above the price, a red down arrow; when it moves below, a green up arrow. Shown when the wait and cumulative count conditions are met.

Record of conditions metMT5 onlyNot a trading instruction
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
Fast EMA period / Fast EMA Period
InpFastEma
10 → 5
Slow EMA period / Slow EMA Period
InpSlowEma
40 → 20
Increment of the SAR acceleration factor / SAR Step
InpSARStep
0.02 → 0.01
Upper limit of the SAR acceleration factor / SAR Maximum
InpSARMaximum
0.2 → 0.1

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 settingsInpFastEma = 10 / InpSlowEma = 40 / InpSARStep = 0.02 / InpSARMaximum = 0.2
EMA Cross SAR Flip Marks default settings
Defaults: Fast 10 / Slow 40, SAR 0.02 / 0.2, upper limit 6, wait 0. Blue and red boxes, light-blue and purple dots, and red down arrows are visible. There is no green up arrow in this captured range.
View the screen in detail at full size
EMA Cross SAR Flip Marks default settings (full size)
Settings change exampleInpFastEma = 5 / InpSlowEma = 20 / InpSARStep = 0.01 / InpSARMaximum = 0.1
EMA Cross SAR Flip Marks settings change example
Changed to Fast 5/Slow 20 and SAR 0.01/0.1. The upper limit 6 and wait 0 remain at their defaults. Boxes and red and green arrows are visible; there are no light blue or purple dots in this range. The green arrow at the bottom edge touches the border.
View the screen in detail at full size
EMA Cross SAR Flip Marks 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

Box: cross of the 2 EMAs

A blue box marks a bar where the Fast EMA moved above the Slow EMA, a red box one where it moved below. The box is placed at the Fast EMA value.

Dot: cross of SAR and the Slow EMA

Light blue marks a bar where SAR moved to at or above the Slow EMA, purple one where it moved to at or below. No dot is placed on a SAR flip bar.

Arrow: conditional SAR flip

When SAR moves above the price, a red down arrow; when it moves below, a green up arrow. Shown when the wait and cumulative count conditions are met.

3

What it measures

Shows a cross of 2 EMAs with a box, a cross of SAR and the Slow EMA with a dot, and an up/down flip of SAR with an arrow. Dots and arrows have a wait count, and arrows have an upper limit on the cumulative bar count on the side before the flip.

How the calculation works

Fast and Slow are EMAs calculated from the close. If Fast≤Slow on the previous bar and Fast>Slow on the current bar, a blue box is placed at the Fast EMA position; if Fast≥Slow on the previous bar and Fast<Slow on the current bar, a red box. A dot is light blue if previous SAR<previous Slow EMA and current SAR≥current Slow EMA, and purple if previous SAR>previous Slow EMA and current SAR≤current Slow EMA. However, no dot is placed on a bar that meets the SAR flip condition. When SAR moves from at or below the previous bar's low to at or above the current high, it is an upward flip and a candidate for a red down arrow; when it moves from at or above the previous bar's high to at or below the current low, it is a downward flip and a candidate for a green up arrow. Dots and arrows are placed at the SAR value. The EMA lines and all SAR points are not drawn; only the marks are drawn when conditions are met.

Conditions and exceptions

Mark checks and bar counting start from the bar after the one where SAR is first calculated. A box having appeared once is not a required condition for dots or arrows. Each time an EMA cross occurs, the upper and lower counts are reset to 0, and the SAR position on that bar is counted. If SAR>high, the upper count is increased by 1; if SAR<low, the lower count by 1. The same side does not need to continue, and a SAR flip does not reset the counts. Bars where SAR equals the high or low, or lies inside the high-low range, do not increase them. The wait is checked with the sum of these 2 cumulative counts, not a simple count of elapsed bars.

Counting and waiting

Mark checks and bar counting start from the bar after the one where SAR is first calculated. A box having appeared once is not a required condition for dots or arrows. Each time an EMA cross occurs, the upper and lower counts are reset to 0, and the SAR position on that bar is counted. If SAR>high, the upper count is increased by 1; if SAR<low, the lower count by 1. The same side does not need to continue, and a SAR flip does not reset the counts. Bars where SAR equals the high or low, or lies inside the high-low range, do not increase them. The wait is checked with the sum of these 2 cumulative counts, not a simple count of elapsed bars.

Arrow upper limit and dot suppression

For an upward SAR flip, the lower-side cumulative count is compared with the upper limit; for a downward SAR flip, the upper-side cumulative count. Even with a flip, an arrow may not appear because of the upper limit or the wait. In that case, the dot on the flip bar also does not appear. A box and a dot, or a box and an arrow, can appear on the same bar.

A concrete counting example

If, after an EMA cross, the counts are upper, upper, lower, upper, the result is upper 3, lower 1, total 4. A flip in between does not reset them to 0. At the next EMA cross, both are reset to 0 and then the position on that cross bar is counted. Bars equal to the high or low do not increase the total, so Wait 7 does not necessarily mean 7 bars later.

What it can and cannot measure

Shows the history of changes in the positional relation of the lines and SAR. It does not calculate the probability of future rises or falls, the profit range, the loss range, or the optimal holding period. Multiple marks arise from the same price series, so they do not necessarily mean that many independent grounds have been added.

4

Situations for reading the display

Look for changes in direction with boxes

Indicator
A blue box records that Fast moved above, a red box that it moved below.
Cross-check
Cross-check the flow of the price's highs and lows with whether the bar where the box appeared has closed.
Check
Even when considering a trade, do not decide on the marks alone; check the price conditions and your own risk criteria.
Caution
In markets with short back-and-forth moves, crosses repeat. Boxes appear without any SAR-side condition.

Do not confuse dots and arrows

Indicator
Light blue and purple are crosses with the Slow EMA; red and green arrows are up/down flips of SAR.
Cross-check
Check the SAR value, whether it is above or below the candle, and its position relative to the previous bar.
Check
Read them as separate events, and do not require them to line up on the same bar.
Caution
A flip bar has no dot. This is the same even when the arrow has been removed by a limit.

Narrow down the marks with the wait

Indicator
Changing Wait from 0 to 7 shows no dots or arrows until the cumulative count reaches 7.
Cross-check
Boxes keep appearing under the same conditions. Check the upper and lower cumulative counts and the reset by EMA crosses.
Check
Compare on another chart with the same symbol, timeframe and history.
Caution
A longer wait does not mean higher accuracy or better results.

Check changes while holding a position

Indicator
When an opposite box or a SAR flip appears, it can be used as a record that the positional relation has changed.
Cross-check
Compare it with your predetermined criteria for holding, taking profit and limiting losses.
Check
Use it as one input when considering closing a position. The marks themselves do not close positions.
Caution
It is not a product that calculates stop-loss prices or exit times.

When there is no mark, distinguish the reason for passing

Indicator
Marks decrease in any of these cases: no cross, no flip, wait not reached, upper limit exceeded, or latest bar hidden.
Cross-check
Check the input ranges and history, and which of the 6 kinds of marks you are waiting for.
Check
Until you can distinguish the cause, do not treat the absence of display as a guarantee of safety or continuation.
Caution
The absence of boxes alone does not necessarily mean that dots and arrows will not appear.
5

Steps for checking the display

1

Apply with the defaults

Load the history in MT5 and first apply only this product. At first, check the 6 kinds of colors and shapes.

2

Distinguish boxes, dots and arrows

Boxes are at the Fast EMA position; dots and arrows are at the SAR position. The EMA lines and all SAR points are not shown.

3

Compare only the inputs you changed

The published change example changes 2 EMA items and 2 SAR items; it is not an example of Wait 7. To compare the wait, change only Wait and use the same symbol, timeframe and history.

4

Distinguish closed bars from the latest bar

By default, no marks are shown on the latest bar. When trying false, distinguish the moment a mark appears from the record after the bar has closed.

6

Installation and checking the package contents

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

Fast EMA period

English item name
Fast EMA Period
Input name
InpFastEma
Default
10
Allowed range
Integer 1–500
Description
Default 10. An exponential moving average using the close. Being shorter than Slow is not enforced.

Slow EMA period

English item name
Slow EMA Period
Input name
InpSlowEma
Default
40
Allowed range
Integer 1–500
Description
Default 40. The cross partner for boxes and the cross partner for SAR dots. Setting it equal to Fast produces no boxes, but it is not a setting that also stops dots and arrows.

Increment of the SAR acceleration factor

English item name
SAR Step
Input name
InpSARStep
Default
0.02
Allowed range
A finite value greater than 0 and at most 1
Description
Default 0.02. The coefficient of the internal SAR calculated from highs and lows. Set it at or below Maximum.

Upper limit of the SAR acceleration factor

English item name
SAR Maximum
Input name
InpSARMaximum
Default
0.2
Allowed range
A finite value at or above Step and at most 1
Description
Default 0.2. The upper limit of the SAR acceleration factor. Values smaller than Step are not accepted.

Upper limit of the cumulative bar count on the side before the flip

English item name
Max Side Bars Before Turn
Input name
InpMaxSideBars
Default
6
Allowed range
Integer 0–1000
Description
Default 6. A red down arrow requires lower-side cumulative count≤upper limit, and a green up arrow requires upper-side cumulative count≤upper limit. It is not the count of immediately consecutive bars. 0 is not a value that disables display; it allows the arrow only when the count on that side is 0. Boxes and dots do not use this upper limit.

Wait before showing dots and arrows

English item name
Wait Bars After Cross
Input name
InpWaitBars
Default
0
Allowed range
Integer 0–1000
Description
The default 0 means no wait. If the sum of the upper and lower cumulative counts is at or above this value, the dot and arrow checks pass. It does not affect boxes. At 7, they are allowed from the bar where the total reaches 7, but it is not a function that later redraws marks that were removed by the wait in the past.

Hide marks on the forming bar

English item name
Closed Bars Only
Input name
InpClosedBarsOnly
Default
true
Allowed range
true / false
Description
Default true. None of the 6 kinds of marks are shown on the latest forming bar. Internal calculation and counting continue. With false, marks on the forming bar may appear, disappear or change.

Brand and QR

English item name
Show Trilogy brand and QR code
Input name
InpTriBrandShow
Default
true
Allowed range
true / false
Description
Displayed with true. Calculated values do not change.

Brand position

English item name
Brand position (chart corner)
Input name
InpTriBrandCorner
Default
Bottom left
Allowed range
Top left / Bottom left / Bottom right / Top right
Description
The default is bottom left.

Horizontal margin

English item name
Brand horizontal offset (pixels)
Input name
InpTriBrandX
Default
10
Allowed range
Integer (pixels)
Description
Negative values are treated as 0, and values above 4000 are treated as 4000.

Vertical margin

English item name
Brand vertical offset (pixels)
Input name
InpTriBrandY
Default
10
Allowed range
Integer (pixels)
Description
Negative values are treated as 0, and values above 4000 are treated as 4000.
8

Usage specifications

Display only

It does not place, modify or close orders. There are no notifications or emails either.

Closed bars and history

Calculates from the full loaded history every time. Even with Closed Bars Only=true, the start position of the history, corrections and additions may change the initial state and cumulative counts of the EMA and SAR, and past marks.

Mark positions

Boxes are placed at the price coordinate of the Fast EMA, and dots and arrows at the price coordinate of the SAR. They are not offset by a fixed number of pixels from the candles. They may be away from the candles or touch the edge of the chart. The positions do not specify order prices or exit prices.

Brand display

Shows Produced by Trilogy Inc. and a QR code to https://www.trgy.co.jp/. When the same medium is used on the same chart, the display is shared. There is 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

No arrows appear

Check the SAR flip condition, the Wait total and the count on the side before the flip against Max Side Bars, and Closed Bars Only. A SAR flip alone does not necessarily show an arrow.

With Wait 7, it does not appear 7 bars later

Bars where SAR equals the high or low, or lies inside the range, are not counted. An EMA cross resets both upper and lower counts to 0. Even on the bar where the wait ends, the conditions for each dot or arrow are still required.

Fast and Slow set to the same value

The EMAs become the same value and no boxes appear. However, SAR-EMA crosses and SAR flips can still occur, so dots and arrows are not disabled.

Dots and arrows appear far apart

Boxes are placed at the price coordinate of the Fast EMA, and dots and arrows at the price coordinate of the SAR. They are not offset by a fixed number of pixels from the candles. They may be away from the candles or touch the edge of the chart. The positions do not specify order prices or exit prices.

The input is not accepted

Set each period to 1–500, SAR to 0<Step≤Maximum≤1, and Max Side Bars and Wait each to 0–1000. Do not use decimals for items that require integers.

Some colors are not visible in the image

If the condition is not met within the display range, that color does not appear. The published default has no green arrows, and the change example has no light blue or purple dots. For details, see the full-size view; on the terminal, adjust the vertical scale and display range.

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

Calculation and reference range

Fast and Slow are EMAs calculated from the close. If Fast≤Slow on the previous bar and Fast>Slow on the current bar, a blue box is placed at the Fast EMA position; if Fast≥Slow on the previous bar and Fast<Slow on the current bar, a red box. A dot is light blue if previous SAR<previous Slow EMA and current SAR≥current Slow EMA, and purple if previous SAR>previous Slow EMA and current SAR≤current Slow EMA. However, no dot is placed on a bar that meets the SAR flip condition. When SAR moves from at or below the previous bar's low to at or above the current high, it is an upward flip and a candidate for a red down arrow; when it moves from at or above the previous bar's high to at or below the current low, it is a downward flip and a candidate for a green up arrow. Dots and arrows are placed at the SAR value. The EMA lines and all SAR points are not drawn; only the marks are drawn when conditions are met.

Initial values and exceptions

Mark checks and bar counting start from the bar after the one where SAR is first calculated. A box having appeared once is not a required condition for dots or arrows. Each time an EMA cross occurs, the upper and lower counts are reset to 0, and the SAR position on that bar is counted. If SAR>high, the upper count is increased by 1; if SAR<low, the lower count by 1. The same side does not need to continue, and a SAR flip does not reset the counts. Bars where SAR equals the high or low, or lies inside the high-low range, do not increase them. The wait is checked with the sum of these 2 cumulative counts, not a simple count of elapsed bars.

Package contents and dependencies

Only MT5 itself and this manual. Account authentication, external indicators and DLLs are not required.

Start of the EMA and SAR

The EMA coefficient is 2/(period+1), and its initial value is the first close in the history. SAR looks for the first bar where the high and low both rise or both fall, and starts from the previous bar's low if upward, or the previous bar's high if downward. After that it advances with the extreme and the acceleration factor, limited by the highs and lows of the previous 2 bars. Checks start from the bar after the first SAR, and no marks are placed before the 3rd bar of the history. With a period of 40, it is not a method that uniformly waits 40 bars.

Start of the history and counting

Even before the first EMA cross, once the SAR calculation starts, counting and the dot/arrow checks are performed. The cumulative counts are not reset by a SAR flip; both are reset only by an EMA cross. A wait of 0 is the entry point that always allows dots and arrows, but the conditions for each mark are still required.

Treatment of equal values

A box cross includes equality on the previous bar and requires being clearly above or below on the current bar. A dot includes the case where it was clearly on the opposite side on the previous bar and reaches equality on the current bar. A SAR flip also includes equality with the high or low, but the conditions that increase the upper and lower counts do not include equality.

Boundary between calculation and trading functions

The EMAs and SAR are calculated within this product. No external indicators are called. Identical initial values or overall display with the MT4 version or other standard SARs are not guaranteed. There are 6 display buffers and 3 internal calculation buffers.