Check the 4 conditions on the previous closed bar
Combines price and band, the change in the typical-price SMA, the change in OsMA, and the difference between SMAs.
Shows with an arrow on the next bar that 4 conditions (envelope, typical-price SMA, OsMA and the difference between 2 SMAs) were all met on the previous closed bar. With the defaults the conditions are strict, and there may be no marks in the display range.
Check the 4 conditions on the previous closed barCombines price and band, the change in the typical-price SMA, the change in OsMA, and the difference between SMAs.
Blue and red arrows on the next barWhen the 4 upward conditions are all met, a blue up arrow; for the opposite 4 conditions, a red down arrow. The arrow is placed on the next bar, not on the bar where the conditions were met.
Distinguish no marks from a stopped calculationNothing is drawn on bars where the 4 conditions are not all met. The published default screen also has no marks. The change example changes only Gap Minimum from 300 to 30.
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.
Combines price and band, the change in the typical-price SMA, the change in OsMA, and the difference between SMAs.
When the 4 upward conditions are all met, a blue up arrow; for the opposite 4 conditions, a red down arrow. The arrow is placed on the next bar, not on the bar where the conditions were met.
Nothing is drawn on bars where the 4 conditions are not all met. The published default screen also has no marks. The change example changes only Gap Minimum from 300 to 30.
Shows with an arrow on the next bar that 4 conditions (envelope, typical-price SMA, OsMA and the difference between 2 SMAs) were all met on the previous closed bar. With the defaults the conditions are strict, and there may be no marks in the display range.
Let t be the bar where the arrow is placed and k=t−1 the preceding closed bar. Upward requires all of: ① close[k] is lower than the lower envelope of the close SMA, ② typical-price SMA[t−Compare Bars] is higher than SMA[k], ③ OsMA[k] is higher than OsMA[k−1], ④ Gap Fast SMA[k]−Gap Slow SMA[k] is within the positive range Minimum–Maximum. Downward requires all of: ① the close is higher than the upper envelope, ② the earlier typical-price SMA is lower than the current one, ③ OsMA has fallen, ④ the SMA difference is within the range −Maximum to −Minimum. Equality in the first 3 conditions means the condition is not met; both ends of the Gap range are included. If the conditions keep being met, arrows also appear on consecutive bars.
Whether an arrow appears is decided using data up to the previous closed bar, but the price coordinate of an up arrow is the low of the bar it is shown on, and that of a down arrow is the high. If the high or low is updated while the bar is forming, the height of the arrow moves. There is no Closed Bars Only input. Because it recalculates from the full history every time, adding to or correcting the history or changing the start position can also change past evaluations.
The band deviation is in %. The Gap minimum and maximum are in points. The price difference is the input value × the price size of 1 point for that symbol. If 1 point = 0.00001, 300 to 2400 points is 0.003 to 0.024; if 1 point = 0.001, it is 0.3 to 2.4. It is not necessarily the same unit as pips.
With Compare Bars=14, it compares the bar 14 bars before the arrow with the bar 1 bar before it. It is not a condition that checks whether all 13 bars in between kept falling; it is a comparison of 2 points.
OsMA is the difference between 2 EMAs of the close minus the SMA of that difference. The upward condition is a rise and the downward condition is a fall; it does not require being above or below 0.
It records when the 4 conditions hold at the same time. It does not calculate future direction, target price, profit rate or the optimal holding period. The 4 conditions are built from the same prices and are not 4 independent guarantees.
| Conditions on the previous closed bar | Blue up arrow | Red down arrow |
|---|---|---|
| Close and envelope | Below the lower line | Above the upper line |
| Typical price SMA | Lower than the compared value | Higher than the compared value |
| OsMA | Up from the bar further back | Down from the bar further back |
| Difference between the SMAs | Within the positive minimum to maximum | Within the negative maximum to minimum |
Load enough history in MT5 and apply only this product. Even if there are no marks at first, check the inputs and history.
The bar 1 bar before the arrow is the bar on which the 4 conditions are judged. Blue means the 4 upward conditions agree and red means the 4 downward conditions agree; they are not trading instructions.
Check the price size of 1 point for the symbol. If the display digits or the symbol differ, the price difference changes even for the same 300 points.
The published settings change example changes Gap Minimum from 300 to 30. Compare on a separate chart with the same symbol, timeframe and history.
| Included file | Purpose / location |
|---|---|
| TRI_Envelope_Four_Condition_Arrows.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 16 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.
InpEnvPeriodInpEnvDeviationInpSmaPeriodInpSmaCompareBarsInpOsmaFastInpOsmaSlowInpOsmaSignalInpGapFastInpGapSlowInpGapPriceInpGapMinInpGapMaxInpTriBrandShowInpTriBrandCornerInpTriBrandXInpTriBrandYIt does not place, modify or close orders. There are no notifications or emails either.
Whether an arrow appears is decided using data up to the previous closed bar, but the price coordinate of an up arrow is the low of the bar it is shown on, and that of a down arrow is the high. If the high or low is updated while the bar is forming, the height of the arrow moves. There is no Closed Bars Only input. Because it recalculates from the full history every time, adding to or correcting the history or changing the start position can also change past evaluations.
The blue up arrow is drawn 10 pixels below the low of the bar it is shown on, and the red down arrow 10 pixels above the high. This is not a fixed price difference, nor a position that specifies entry 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.
By default the Gap minimum is 300 points. Check for missing conditions among the 4, the number of bars needed at the start, and the input combination. The published settings change example is for explaining the display and is not an adjustment that guarantees performance.
The bands, each average and OsMA are internal calculations; only the blue/red arrows are drawn on screen. There is no input to switch their display on or off.
Whether an arrow appears is decided using data up to the previous closed bar, but the price coordinate of an up arrow is the low of the bar it is shown on, and that of a down arrow is the high. If the high or low is updated while the bar is forming, the height of the arrow moves. There is no Closed Bars Only input. Because it recalculates from the full history every time, adding to or correcting the history or changing the start position can also change past evaluations.
By default OsMA is 30/5 and Gap is 25/15. Do not swap them based on the names alone. Changing the order of subtraction changes things such as the sign of the difference.
With OsMA Fast=Slow or Signal=1, OsMA no longer changes. With Gap Fast=Slow and Minimum>0, no marks appear either. Even settings within range do not always produce marks.
Set each period to 1 to 500, Compare Bars to 2 to 500, the deviation to 0 to 100%, and Gap to 0≤Minimum≤Maximum≤1,000,000 points.
Adjust the chart's vertical scale and display range in the terminal. The images in the manual can also be checked 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.
Let t be the bar where the arrow is placed and k=t−1 the preceding closed bar. Upward requires all of: ① close[k] is lower than the lower envelope of the close SMA, ② typical-price SMA[t−Compare Bars] is higher than SMA[k], ③ OsMA[k] is higher than OsMA[k−1], ④ Gap Fast SMA[k]−Gap Slow SMA[k] is within the positive range Minimum–Maximum. Downward requires all of: ① the close is higher than the upper envelope, ② the earlier typical-price SMA is lower than the current one, ③ OsMA has fallen, ④ the SMA difference is within the range −Maximum to −Minimum. Equality in the first 3 conditions means the condition is not met; both ends of the Gap range are included. If the conditions keep being met, arrows also appear on consecutive bars.
Whether an arrow appears is decided using data up to the previous closed bar, but the price coordinate of an up arrow is the low of the bar it is shown on, and that of a down arrow is the high. If the high or low is updated while the bar is forming, the height of the arrow moves. There is no Closed Bars Only input. Because it recalculates from the full history every time, adding to or correcting the history or changing the start position can also change past evaluations.
Only MT5 itself and this manual. Account authentication, external indicators and DLLs are not required.
Center=SMA(close,Envelope Period), upper/lower lines=center×(1±Deviation/100). Typical price=(high+low+close)/3. MACD=EMA(close,Fast)−EMA(close,Slow), OsMA=MACD−SMA(MACD,Signal). Gap is the difference between 2 SMAs that use the shared applied price.
EMA is calculated from the oldest close in the history with coefficient 2/(period+1). SMA has no value until the required number of bars is available. The 0-based display bar t is judged only once it is at least the maximum of Envelope Period, Typical SMA Period+Compare Bars−1, OsMA Signal+1, Gap Fast and Gap Slow. By default t=25, that is, from the 26th bar of history onward. If the conditions do not hold, it comes even later.
The close vs the bands, the 2 typical price SMA points and the 2 OsMA points use strict greater/less comparisons. Equal values do not qualify. Only Gap includes equality at both ends. Gap=0 is within range if Minimum=0, but for up or down the other 3 conditions must also hold at the same time.
Gap Price is shared by the 2 Gap SMAs. You cannot set a different price for only one of them. The bands and OsMA are fixed to the close, and the typical price SMA to the typical price. There are no automatic per-symbol presets, and no notification or order functions.