MT5 indicators← Envelope Four Condition Arrows 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

Envelope Four Condition Arrows

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.

Indicator name: Envelope Four Condition ArrowsMetaTrader 5Main chart

Read the 4 conditions being met on the next bar

1Check the 4 conditions on the previous closed bar2Blue and red arrows on the next bar3Distinguish no marks from a stopped calculation
Schematic diagram of how to read it. This is not an actual terminal screen.
1

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.

2

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.

3

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.

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
Lower limit of the absolute Gap / Gap Minimum (points)
InpGapMin
300 → 30

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 settingsInpGapMin = 300
Envelope Four Condition Arrows default settings
Default settings. There are no arrows in this displayed range. This is because the 4 conditions, including Gap Minimum 300 and Maximum 2400 points, are not all met; the absence of display alone does not show that calculation has stopped.
View the screen in detail at full size
Envelope Four Condition Arrows default settings (full size)
Settings change exampleInpGapMin = 30
Envelope Four Condition Arrows settings change example
Only Gap Minimum is changed, from 300→30 points. The other inputs are the same. Blue up arrows and red down arrows are visible. The red arrow at the top edge is partly cut off, and the blue arrow at the bottom edge touches the border. The changed value is not a recommended setting.
View the screen in detail at full size
Envelope Four Condition Arrows 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

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.

Blue and red arrows on the next bar

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.

Distinguish no marks from a stopped calculation

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.

3

What it measures

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.

How the calculation works

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.

Conditions and exceptions

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.

Bands and Gap use different units

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.

Typical price SMA comparison

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 a change, not a level

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.

What it cannot measure

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 barBlue up arrowRed down arrow
Close and envelopeBelow the lower lineAbove the upper line
Typical price SMALower than the compared valueHigher than the compared value
OsMAUp from the bar further backDown from the bar further back
Difference between the SMAsWithin the positive minimum to maximumWithin the negative maximum to minimum
4

Situations for reading the display

Reading a bar with a blue arrow

Indicator
It is a record that the lower band side, SMA fall, OsMA rise and positive Gap conditions all held on the immediately preceding closed bar.
Cross-check
Check the price state of the bar 1 bar before the arrow bar, not the arrow bar itself.
Check
Even when considering a trade, check the price flow and your own risk criteria separately.
Caution
The decline may continue, and it is not a mark that confirms a rebound.

Reading a bar with a red arrow

Indicator
On the immediately preceding bar, the upper band side, SMA rise, OsMA fall and negative Gap conditions all hold.
Cross-check
Observe it separately from new highs and the state of other timeframes.
Check
Even when using it as material for considering holding or exiting, compare it with criteria you decided in advance.
Caution
The mark does not take profit or cut losses, and it does not specify a price either.

No marks with the defaults

Indicator
If any of the 4 conditions is missing, no arrow appears. The published default image is also in this state.
Cross-check
Check the history and input ranges, and look at the Gap unit and its minimum and maximum.
Check
Do not conclude that having no display is a fault; if needed, compare the settings change example on a separate chart.
Caution
Even if you lower the minimum as in the settings change example, marks do not necessarily always appear.

Consecutive arrows and the latest bar

Indicator
If the conditions continue, arrows appear on consecutive bars. They can also be shown on the latest bar.
Cross-check
Confirm that this is not a product that detects only new crossings.
Check
Do not treat consecutive marks as independent additional evidence; read them as a continuation of the same state.
Caution
The judgment for the latest bar depends on the closed bar, but the arrow's height moves with that bar's high and low.
5

Steps for checking the display

1

Apply with the defaults

Load enough history in MT5 and apply only this product. Even if there are no marks at first, check the inputs and history.

2

Distinguish the condition bar from the display bar

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.

3

Check the Gap unit

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.

4

Compare only 1 item

The published settings change example changes Gap Minimum from 300 to 30. Compare on a separate chart with the same symbol, timeframe and history.

6

Installation and checking the package contents

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

Center SMA period of the envelope

English item name
Envelope Period
Input name
InpEnvPeriod
Default
2
Allowed range
Integer 1–500
Description
Default 2. The upper and lower bands are calculated internally around a simple moving average of the close. The band lines themselves are not drawn.

Deviation up and down from the center

English item name
Envelope Deviation (%)
Input name
InpEnvDeviation
Default
0.0032
Allowed range
Finite value from 0 to 100 (%)
Description
Default 0.0032%. The coefficient is 0.0032÷100=0.000032. It widens the center value up and down by the same rate. It is a different unit from points or price differences.

Period of the typical price SMA

English item name
Typical SMA Period
Input name
InpSmaPeriod
Default
7
Allowed range
Integer 1–500
Description
Default 7. A simple average of typical price = (high+low+close)/3. Gap Price does not change it.

Comparison position of the typical price SMA

English item name
SMA Compare Bars
Input name
InpSmaCompareBars
Default
14
Allowed range
Integer 2–500
Description
Default 14. It compares the bars 14 bars and 1 bar before the bar where the arrow is placed, so the interval between the 2 compared bars is 13 bars. It does not mean 14 bars before the judged bar.

1st EMA period of the OsMA difference

English item name
OsMA Fast EMA
Input name
InpOsmaFast
Default
30
Allowed range
Integer 1–500
Description
Default 30. The name is Fast, but by default it is longer than Slow's 5. The 2nd EMA is subtracted from the 1st EMA. They are not reordered from shortest to longest.

2nd EMA period of the OsMA difference

English item name
OsMA Slow EMA
Input name
InpOsmaSlow
Default
5
Allowed range
Integer 1–500
Description
Default 5. Uses an EMA of the close. With the same period as Fast, OsMA becomes 0 and does not meet the strict up/down change conditions, so no marks appear.

Period of the OsMA signal SMA

English item name
OsMA Signal SMA
Input name
InpOsmaSignal
Default
2
Allowed range
Integer 1–500
Description
Default 2. The EMA difference is simply averaged over this period and subtracted from the original difference to give OsMA. With 1, OsMA becomes 0 and no marks appear.

1st SMA period of Gap

English item name
Gap Fast SMA
Input name
InpGapFast
Default
25
Allowed range
Integer 1–500
Description
Default 25. Gap is obtained by subtracting the 2nd SMA from this average. Even with the name Fast, it is not necessarily shorter than Slow.

2nd SMA period of Gap

English item name
Gap Slow SMA
Input name
InpGapSlow
Default
15
Allowed range
Integer 1–500
Description
Default 15. If both periods are the same, Gap is 0. If Minimum is positive, the Gap condition is not met; if Minimum=0, the result is decided by the other 3 conditions.

Price shared by the 2 Gap SMAs

English item name
Gap Price
Input name
InpGapPrice
Default
Open
Allowed range
Close / Open / High / Low / Median / Typical / Weighted
Description
Default Open. Median=(high+low)/2, Typical=(high+low+close)/3, Weighted=(high+low+2×close)/4. It does not change the prices used by the envelope, the typical price SMA or OsMA.

Lower limit of the absolute Gap value

English item name
Gap Minimum (points)
Input name
InpGapMin
Default
300
Allowed range
Finite value from 0 up to Maximum (points)
Description
Default 300. Requires a positive Gap for up and a negative Gap for down. 0 does not disable the whole Gap condition. Lowering it can let weak differences into the range too.

Upper limit of the absolute Gap value

English item name
Gap Maximum (points)
Input name
InpGapMax
Default
2400
Allowed range
Finite value from Minimum up to 1,000,000 (points)
Description
Default 2400. Differences above the upper limit do not pass. If the upper and lower limits are equal, only differences equal to that price difference pass. Both ends are included.

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.

Evaluation and coordinates on the latest bar

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.

Mark positions

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.

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

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 or OsMA are not visible

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.

The arrow moves even though the conditions are on the closed bar

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.

Fast is longer than Slow

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.

Marks disappeared after changing a period

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.

The settings are not accepted

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.

Arrows are cut off at the edge

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.

10

Technical information and specification details

Calculation and reference 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.

Initial values and exceptions

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.

Package contents and dependencies

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

Formula breakdown

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.

Initial values and start position

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.

Handling of equal values and 0

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.

Shared price and scope

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.