MT5 indicators← Four Bar Swing State 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

Four Bar Swing State Arrows

Remembers an up or down state from the pattern of the highs, lows and closes of the previous 4 bars, and draws arrows only on bars where the state switched.

Indicator name: Four Bar Swing State ArrowsMetaTrader 5Main chart

How to read the display

1Judges the pattern of the previous 4 bars2Marks only on bars where the state changed3Blank while the same state continues
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Judges the pattern of the previous 4 barsUses the 4 bars before the bar where the mark is placed. The direction is not determined from the current bar's values.

2

Marks only on bars where the state changedA green up arrow records a switch to the up state, and a red down arrow a switch to the down state.

3

Blank while the same state continuesNo new arrow appears even if patterns in the same direction continue. A bar without a mark cannot be read as a neutral state.

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
Check the close turn / Close Turn Check
InpCloseTurn
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 settingsInpCloseTurn = true
Four Bar Swing State Arrows default settings
Default settings. The green up arrows and red down arrows are on bars where the state changed. Part of the arrow at the left edge is cut off.
View the screen in detail at full size
Four Bar Swing State Arrows default settings (full size)
Settings change exampleInpCloseTurn = false
Four Bar Swing State Arrows settings change example
Close Turn Check=false. An example that removes only the last close-turn condition. The other conditions remain.
View the screen in detail at full size
Four Bar Swing State 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

Judges the pattern of the previous 4 bars

Uses the 4 bars before the bar where the mark is placed. The direction is not determined from the current bar's values.

Marks only on bars where the state changed

A green up arrow records a switch to the up state, and a red down arrow a switch to the down state.

Blank while the same state continues

No new arrow appears even if patterns in the same direction continue. A bar without a mark cannot be read as a neutral state.

3

What it measures

Remembers an up or down state from the pattern of the highs, lows and closes of the previous 4 bars, and draws arrows only on bars where the state switched.

How the calculation works

With the mark bar as t, up is the case that meets low[t−4]>low[t−2], low[t−3]>low[t−2] and low[t−2]≤low[t−1], plus close[t−4]>close[t−3]>close[t−2]. With Close Turn Check=true, close[t−2]<close[t−1] is also required. For down, highs are compared instead, and all the inequalities, including the close relations, are reversed. If not met, the previous state is kept, and a mark is placed only on the t where the state changed.

Conditions and exceptions

The start of history begins with no state. An arrow also appears on the first bar where a pattern is met. Judgment starts from the 5th bar at the earliest. Even with Close Turn Check=false, the first 2 up/down comparisons of the closes and the high/low conditions remain. If the history of the closed past bars does not change, the direction does not change on the forming bar, but the position of the arrow placed at that bar's high or low moves.

4

Situations for reading the display

Separate the price from the meaning of the mark

Indicator
Uses the 4 bars before the bar where the mark is placed. The direction is not determined from the current bar's values.
Cross-check
Cross-check the prices and settings at the same time.
Check
Check the bars and prices referenced and how equal values are handled.
Caution
Arrows and dots are not recommendations to place or close orders.

Compare setting differences

Indicator
Change example: Close Turn Check = false.
Cross-check
Use the same symbol, timeframe and history.
Check
Look at how the changed setting relates to the increase or decrease and the position of the marks.
Caution
The published settings are not recommended values.

Reading intervals without marks

Indicator
The start of history begins with no state. An arrow also appears on the first bar where a pattern is met. Judgment starts from the 5th bar at the earliest. Even with Close Turn Check=false, the first 2 up/down comparisons of the closes and the high/low conditions remain. If the history of the closed past bars does not change, the direction does not change on the forming bar, but the position of the arrow placed at that bar's high or low moves.
Cross-check
Check the required history and whether the conditions are met.
Check
Do not treat the absence of marks as the calculation having stopped.
Caution
Nothing may be displayed during periods when the conditions are not met.
5

Steps for checking the display

1

Apply with the defaults

Load the history in MT5, and first apply only this product to the chart.

2

Check the role of the display

Uses the 4 bars before the bar where the mark is placed. The direction is not determined from the current bar's values.

3

Comparing settings

Put the default and the change example on separate charts, with the same symbol, timeframe and history.

4

Separate the current bar's direction from its position

Even with false, the direction judgment uses the previous 4 closed bars. What can move is the high and low of the current bar where the arrow is placed.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Four_Bar_Swing_State_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 6 inputs. Change them on the Inputs tab of the properties. The English item names and input names defined in the source are shown together.

Check the close turn

English item name
Close Turn Check
Input name
InpCloseTurn
Default
true
Allowed range
true / false
Description
true requires the 4th close to turn back in the opposite direction from the 3rd. false removes only the last close-turn condition.

Place marks on closed bars only

English item name
Closed Bars Only
Input name
InpClosedBarsOnly
Default
true
Allowed range
true / false
Description
true hides marks on the latest forming bar. false shows them while forming, and marks before the bar closes need to be read separately.

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 history and state

Because the state accumulates from the start of the history, changes of the history start position, filling-in or corrections may also change later states and arrows. The price of the current bar alone does not change the direction.

Mark positions

Up arrows are drawn 10 pixels below the low, and down arrows 10 pixels above the high. This is not a fixed distance in price.

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 marks, or blanks in the middle

The start of history begins with no state. An arrow also appears on the first bar where a pattern is met. Judgment starts from the 5th bar at the earliest. Even with Close Turn Check=false, the first 2 up/down comparisons of the closes and the high/low conditions remain. If the history of the closed past bars does not change, the direction does not change on the forming bar, but the position of the arrow placed at that bar's high or low moves.

There is a pattern but no mark

No mark appears even if patterns of the same state continue. Check the initial state and the history up to the previous bar. The input is on/off only.

Marks differ from another indicator

With the mark bar as t, up is the case that meets low[t−4]>low[t−2], low[t−3]>low[t−2] and low[t−2]≤low[t−1], plus close[t−4]>close[t−3]>close[t−2]. With Close Turn Check=true, close[t−2]<close[t−1] is also required. For down, highs are compared instead, and all the inequalities, including the close relations, are reversed. If not met, the previous state is kept, and a mark is placed only on the t where the state changed.

Displays overlap

Use separate charts, or adjust the brand position and margins. The images 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

With the mark bar as t, up is the case that meets low[t−4]>low[t−2], low[t−3]>low[t−2] and low[t−2]≤low[t−1], plus close[t−4]>close[t−3]>close[t−2]. With Close Turn Check=true, close[t−2]<close[t−1] is also required. For down, highs are compared instead, and all the inequalities, including the close relations, are reversed. If not met, the previous state is kept, and a mark is placed only on the t where the state changed.

Initial values and exceptions

The start of history begins with no state. An arrow also appears on the first bar where a pattern is met. Judgment starts from the 5th bar at the earliest. Even with Close Turn Check=false, the first 2 up/down comparisons of the closes and the high/low conditions remain. If the history of the closed past bars does not change, the direction does not change on the forming bar, but the position of the arrow placed at that bar's high or low moves.

Package contents and dependencies

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