MT5 indicators← Swing Turn Midline 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

Swing Turn Midline

Finds the position held after the lowest low or highest high in the period was updated, and shows turn marks and the midline of the range using conditions up to the previous closed bar. Marks are not moved back to past candidates; they are placed on the bar after the judgment.

Indicator name: Swing Turn MidlineMetaTrader 5Price chart

After the previous bar closes, the mark and line appear on the next bar

Read the candidate price and the output time separatelyCandidate barOutput barAfter the conditions are metShown here
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Blue up and red downBlue is a mark that met the low-side conditions, and red the high-side conditions.

2

Light blue and orange-red linesThe midpoint of the highest high and lowest low from each low-side or high-side candidate up to the previous bar.

3

Also appears on the latest barThe values of the latest bar itself are not used; the output is decided from data up to the previous closed bar.

Default period is 8 barsMarks are placed at the candidate priceThe line period is counted from after the mark
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
Period for checking highs and lows / Range Period (2 to 500)
InpPeriod
8 → 20
Bars to show the line after the mark / Line Bars After The Mark (0 to 500)
InpLineBars
8 → 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 settingsInpPeriod = 8 / InpLineBars = 8
Swing Turn Midline default settings
Defaults: period 8 and 8 bars of line after a mark. The price of the line moves when the high/low of the range changes. Some low-side arrows are cut off at the bottom edge of the screen.
View the screen in detail at full size
Swing Turn Midline default settings (actual size)
Settings change exampleInpPeriod = 20 / InpLineBars = 30
Swing Turn Midline settings change example
An example with the period changed to 20 and the line after the mark to 30 bars. Because 2 inputs are changed at once, differences in the lines and marks cannot be attributed to either one alone. Some arrows at the bottom edge are cut off.
View the screen in detail at full size
Swing Turn Midline settings change example (actual 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

What to look at

Marks selected by an extreme-value update in the recent period and the high/low conditions after it.

Meaning of the line

The midpoint of the highest high and lowest low of the range from the candidate to the previous bar. It is not a moving average or a fixed target price.

When does it appear

It appears on the next bar after the required conditions are met up to the previous bar. It does not necessarily appear a fixed number of bars after the candidate.

3

What it measures

The low side and the high side are tracked separately, and the candidate, mark and line display periods are handled separately.

Low-side candidate

Looks for a shape where the lowest low in the period falls and the next bar keeps the same lowest low. Of those that can be confirmed up to the previous bar, the newest candidate is used.

Low-side mark

Appears when the low of the previous bar is strictly higher than the lowest low of the 3 bars before it, and there is no low-side mark yet since the candidate. The high side uses the opposite comparison.

Range midline

Adds the highest high and lowest low from the candidate to the previous bar and divides by 2. When the range widens, the price of the line can change.

Line period

While there is no mark yet, the line is shown. After a mark appears, it is shown up to the set number of bars and then left blank. When a new candidate is selected, the range is revised.

4

Situations for reading the display

Only the line is showing

Indicator
The midline and whether there is a mark
Cross-check
Turn conditions after the candidate
Check
Check whether the mark conditions are not yet met
Caution
The line while there is no mark is not cut off by the Line Bars count.

Set the line period to 0

Indicator
Cases where the line remains
Cross-check
Whether there is a mark, and the output bar
Check
Confirm that the line appears before the mark and on the mark bar
Caution
0 does not disable the line display as a whole.

The line is interrupted

Indicator
Blanks in the midline
Cross-check
Bars elapsed since the first mark
Check
Check whether the period was exceeded or there is no candidate
Caution
A blank is not a value for profit or loss or for market strength.

The mark is to the right of the past peak or trough

Indicator
Blue and red arrows
Cross-check
Candidate price and the time the conditions were confirmed
Check
Read the mark's time as the bar after the judgment
Caution
Do not interpret it as meaning the mark was already visible on the candidate bar at that time.
5

Steps for checking the display

1

Load only this product

With the default period 8 and line 8 bars, check the blue and red marks and the light blue and orange-red lines.

2

Find the candidate shape

Check the update of the lowest low or highest high in the period and the shape held on the next bar.

3

Compare the mark with the previous bar

Check the previous closed bar, not the latest bar, and the highs and lows of the 3 bars before it.

4

Compare line periods

On a separate chart, change only Line Bars. Even at 0, the line appears before the mark and on the mark bar.

6

Installation and checking the package contents

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

Period for checking highs and lows

English item name
Range Period (2 to 500)
Input name
InpPeriod
Default
8
Allowed range
Integer 2 to 500
Description
Candidates are found using the lowest low and highest high of the most recent P bars. Default 8. Making it larger selects different candidates.

Bars to show the line after the mark

English item name
Line Bars After The Mark (0 to 500)
Input name
InpLineBars
Default
8
Allowed range
Integer 0 to 500
Description
The line is shown while the number of bars elapsed since the first mark is at or below this value. The line is also shown before the mark and on the mark bar. 0 does not hide the line as a whole.

Brand and QR

English item name
Show Trilogy brand and QR code
Input name
InpTriBrandShow
Default
true
Allowed range
true / false
Description
Switches only the display. The calculation conditions 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
Default 10. Negative numbers are treated as 0, and values above 4000 as 4000.

Vertical margin

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

Usage specifications

Forming bar

The value of output bar t is decided using data up to t−1. If the history and settings are the same, its mark and line do not change merely because the high or low of t moves. There is no Closed Bars Only input.

Lines and execution prices

The line visualizes the midpoint of the range. It is not a function for automatic orders, take profit, stop loss or notifications.

Low and high are separate

The low side and the high side are calculated independently. There is no rule that they always alternate.

When the history is changed

The case where only subsequent bars increase with the same history and the same settings is different from filling in or correcting the history or changing the loading start position. In recalculation with changed history or settings, past display may also change.

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 are found

Check whether there is enough history for the required number of bars and whether there are candidates that meet the conditions. Widen the visible range and look at earlier bars as well.

Arrows are cut off at the edge of the screen

Adjust the margin of the price scale and the visible range. Because a mark places a past candidate price on a later bar, it can be far from the current candle.

Bar for the mark

A mark is placed on the bar where the conditions can be confirmed. Marks are not moved back afterwards to the bar of the past peak or trough.

There is no initial display

Output checking starts at t=P+2, counted from the oldest side. At least P+3 bars are needed, and if there is still no candidate after that, neither the line nor the marks appear.

An input was rejected

Range Period is an integer from 2 to 500 and Line Bars from 0 to 500. Out of range, the calculation does not start.

The line is not horizontal

The midline's calculation range extends from the candidate to the previous bar. If the range's high or low changes, the midpoint also moves.

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

Formula for selecting the candidate

Let LL be the lowest low of the most recent P bars. Search from t−1 toward older bars, and from the first j where LL[j−2]>LL[j−1] and LL[j−1]=LL[j], select b=j−1. Only the range of history that can be calculated is used. The high side reverses the comparison of HH.

Formula for placing the mark

If there is no mark of the same side in b to t−1 and min(low[t−4..t−2])<low[t−1], low[b] is placed on bar t. The high side places high[b] when max(high[t−4..t−2])>high[t−1]. No distance is added.

Formula for showing the line

Let s be the bar of the first mark of the same side from candidate b to t−1. The line is shown if there is no s or if t−s≤Line Bars. The value is the midpoint of the highest high and lowest low of the same range.

How the display works

It does not move marks back to past bottoms or tops, offset them 5 points from the candidate price, or place a separate waiting point. When there is no candidate, the previous bar is not used in its place; the line and the marks are left blank.