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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Load the history in MT5 and first apply only this product. At first, check the 6 kinds of colors and shapes.
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.
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.
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.
| Included file | Purpose / location |
|---|---|
| TRI_EMA_Cross_SAR_Flip_Marks.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 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.
InpFastEmaInpSlowEmaInpSARStepInpSARMaximumInpMaxSideBarsInpWaitBarsInpClosedBarsOnlyInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYIt does not place, modify or close orders. There are no notifications or emails either.
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.
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.
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.
The display is a record of calculation results. It does not direct trading decisions and does not guarantee future price movements.
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.
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.
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.
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.
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.
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.
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.
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.
Only MT5 itself and this manual. Account authentication, external indicators and DLLs are not required.
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.
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.
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.
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.