Skip to main content
Version: 2.0

ISL - Initial Stop Loss

Concept diagram

The concept diagram provided below depicts the function block associated with this page.

Concept diagram, Initial Stop Loss.png

Initial stop loss calculation mode

The Expert Advisor Builder is designed to simplify the complex topic of automated trading. As part of this, it breaks down a trade into its most basic components, one of which is the initial stop loss level. The stop loss is a crucial component of any trade and can be static or dynamic. Regardless of the stop loss type, an initial value is always set for it. This value is often used for other calculations due to its significance in risk and money management.

The initial stop loss refers to the first stop loss level set when a trade is opened. Even if the configured trailing stop loss method alters the stop loss immediately after opening, the initial stop loss is applied at least momentarily. Please refer to the relevant article for more information on how a trade is abstracted.

There are various options for setting the initial stop loss. These can be selected using the input parameter > (ISL) Selection. Input parameters configure some options, while others are derived from a signal block. For instance, candle patterns often come with ideal stop loss values derived from the pattern itself. The table below summarizes all selectable options to determine the initial stop loss.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (ISL) Selection
(IN_enmIslSelection)
ATRSNumeric values usable in SET files:
0 - OFF
1 - FIX PIPS
2 - RATE OF CHANGE
3 - ATRS
4 - MARKET HILO
5 - CHART ANALYZER
6 - CANDLE SEARCH
7 - PATTERN SEARCH
8 - FIBONACCI SEARCH

> (ISL) Selection = OFF

If you want your trading module to place orders without any stop loss, select the OFF option. However, be aware that this carries a high risk and does not allow for a trailing stop loss configuration or trade splitting tactics. It is generally recommended to configure initial stop loss values to limit losses.

The OFF option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = OFF.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_2_v_2_0.zip.

> (ISL) Selection = FIX PIPS

If you prefer to set a fixed amount of pips as the initial stop loss, select FIX PIPS and configure the input parameter > (ISL) Fix pips. This will result in every trade being opened with the same stop loss difference measured in pips.

The FIX PIPS option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = FIX PIPS.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_3_v_2_0.zip.

> (ISL) Selection = RATE OF CHANGE

While a stop loss based on a static amount of pips may work in the short-term, it often proves suboptimal in the long run as market conditions change over time. Therefore, you can also define the initial stop loss distance as a relative value to the current price. When RATE OF CHANGE (ROC) is selected, the price at the moment the trade is sent represents 100%, for example, 10000 USD. If 0.003 is configured for the input parameter > (ISL) Rate of change (min value), the actual stop loss difference is 0.003 ROC * 10000 USD = 30 USD. As the price changes, the initial stop loss difference adapts accordingly. This is particularly useful for assets with rising prices over time, such as indices.

The ROC option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = RATE OF CHANGE.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_4_v_2_0.zip.

> (ISL) Selection = ATRS

When ATRS is selected as the initial stop loss, an ATR indicator value defines the initial stop loss. Typically, the raw ATR indicator value is too small to be used as an initial stop loss immediately, so you can use the input parameters > (ISL) ATRS factor to multiply the raw ATR indicator value before using it. Additionally, with > (ISL) ATRS period, the period of the underlying ATR indicator can be adjusted. Both options can be used to move the initial stop loss value.

The ATRS option is illustrated in the image below:

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = ATRS.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_5_v_2_0.zip.

> (ISL) Selection = MARKET HILO

The MARKET HILO algorithm searches for reasonable previous lows (long trades) or highs (short trades) depending on the trade direction and uses these values as the initial stop loss. Various input parameters allow you to adjust this algorithm. For a detailed explanation, please refer to the relevant section. This algorithm generally enables the search for previous support and resistance levels to be used as an initial stop loss. The algorithm for identifying support and resistance levels is lightweight and does not require a chart analyzer module.

The MARKET HILO option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = MARKET HILO.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_6_v_2_0.zip.

> (ISL) Selection = CHART ANALYZER

Specific trading signals come with stop loss recommendations, including those from the CHART ANALYZER. The chart analyzer engine is a robust tool for identifying support levels and can derive stop loss values from these. At least one chart analyzer must be enabled as a data source to utilize this option. The example below shows a trade with its stop loss level set precisely at a previous support. For information on adjusting the selection process, please refer to the configuration section for the chart analyzer. If multiple submodules of the chart analyzer are enabled, the sum of all found support and resistance levels is used for the initial stop loss selection.

The CHART ANALYZER option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = CHART ANALYZER.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_7_v_2_0.zip.

> (ISL) Selection = CANDLE SEARCH

Many, but not all, typical candle patterns also provide stop loss recommendations. If signals are generated with the candle search engine, these can be used by selecting the CANDLE SEARCH option. This requires enabling the candle search and the candle pattern to have an ideal stop loss. The RATE OF CHANGE value is a backup if no ideal stop loss value is provided. For a complete understanding of this option, please refer to the input configurations for the candle search engine.

The CANDLE SEARCH option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = CANDLE SEARCH.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_8_v_2_0.zip.

> (ISL) Selection = PATTERN SEARCH

Some pattern search patterns also define ideal stop losses. If so, you can use them as the initial stop loss by selecting the PATTERN SEARCH option. The pattern search engine must be the primary trade signal source. The RATE OF CHANGE value is a backup if no ideal stop loss value is provided. Refer to this user manual section for information on configuring this functional block.

The PATTERN SEARCH option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = PATTERN SEARCH.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_9_v_2_0.zip.

> (ISL) Selection = FIBONACCI SEARCH

In many cases, the retracement level of a Fibonacci pattern is a good option for ideal stop loss levels. You can use one of these directly by selecting FIBONACCI SEARCH as the source of the initial stop losses. The RATE OF CHANGE value is a backup if no ideal stop loss value is provided. Please refer to the related documentation to learn how to set the stop loss to different retracement levels.

The FIBONACCI SEARCH option is illustrated in the image below.

Configuration, Initial Stop Loss, Initial stop loss calculation mode, Selection = FIBONACCI SEARCH.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_10_v_2_0.zip.

Parameters for fix pips based initial stop loss

In the table below, you can find all input parameters used to adjust the FIX PIPS option.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (ISL) Fix pips
(IN_nIslFixPips)
200The input value cannot be smaller or equal to 0.
The input parameter is only used when FIX PIPS is selected for > (ISL) Selection.

Using a fixed amount of pips is the most straightforward concept in defining the initial stop loss value. Nevertheless, the following four chart examples demonstrate how the initial stop loss value is placed further away as the > (ISL) Fix pips input parameter is larger.

Configuration, Initial Stop Loss, Parameters for fix pips based initial stop loss, Example charts.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_11_v_2_0.zip.

Parameters for rate of change based initial stop loss

The table below shows all input parameters used to adjust the RATE OF CHANGE option.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (ISL) Rate of change (min value)
(IN_dIslRateOfChange)
0.0003The input value cannot be smaller or equal to 0.
The input parameter is used when RATE OF CHANGE is selected for > (ISL) Selection or as the backup value if the initial stop loss is too close to the actual price.

As mentioned earlier, the RATE OF CHANGE option allows you to define the initial stop loss difference as a relative value, using the price as a reference when opening. When RATE OF CHANGE (ROC) is selected, the opening price represents 100%, for example, 10.000 USD. If 0.003 is configured for the input parameter > (ISL) Rate of change (min value), the actual stop loss difference is calculated by 0.003 ROC 10.000 USD = 30 USD. As the price changes, the initial stop loss difference adapts accordingly. This is particularly useful for assets with rising prices over time, such as indices. For example, if the indices' price grows to 11.000 USD, the initial stop loss difference will become 0.003 ROC 11.000 USD = 33 USD.

In addition to its relative nature, this parameter is the minimum initial stop loss value for the entire ISL module. For instance, when using the ATRS option, the initial stop loss may be too close to the current price. If the initial stop loss distance is smaller than the rate of change defined value, the rate of change value is used instead. This means the input parameter > (ISL) Rate of change (min value) is actively used for calculations regardless of whether the RATE OF CHANGE option is used as the initial stop loss calculation method.

As demonstrated in the series of examples below, the larger the rate of change value is configured, the larger the initial stop loss difference becomes.

Configuration, Initial Stop Loss, Parameters for rate of change based initial stop loss, Example charts.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_12_v_2_0.zip.

Parameters for average true range based initial stop loss

The table below lists all the input parameters to adjust the ATRS option.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (ISL) ATRS factor
(IN_dIslAtrsFactor)
2.5The input value cannot be smaller or equal to 0.
The input parameter is only used when ATRS is selected for > (ISL) Selection.
> (ISL) ATRS period
(IN_nIslAtrsPeriod)
14The input value cannot be smaller or equal to 0.
The input parameter is only used when ATRS is selected for > (ISL) Selection.

When using the ATRS option for the initial stop loss, you can adjust its behavior using the > (ISL) ATRS factor and > (ISL) ATRS period input parameters. Typically, the raw ATR indicator value is too small to be used directly as the initial stop loss difference, so it's common practice to multiply the raw indicator value with a factor before using it. This is where the input parameters > (ISL) ATRS factor comes into play. Another critical parameter is the period of the used ATR indicator. To adjust the period of the underlying ATR indicator, please use the input parameters > (ISL) ATRS period.

By adjusting these input parameters, you can increase or decrease the initial stop loss difference.

Configuration, Initial Stop Loss, Parameters for average true range based initial stop loss, Example charts.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_13_v_2_0.zip.

Parameters for HiLo based initial stop loss

The table below lists all the input parameters used to adjust the MARKET HILO option.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (ISL) Market HiLo range
(IN_nIslMarketHiLoRange)
100The input value cannot be smaller or equal to 0.
The input parameter is only used when MARKET HILO is selected for > (ISL) Selection.
> (ISL) Market HiLo min
(IN_dIslMarketHiLoMin)
0.2The input value has to be between 0 and 1.
The input parameter is only used when MARKET HILO is selected for > (ISL) Selection.
> (ISL) Market HiLo max
(IN_dIslMarketHiLoMax)
1.0The input value has to be between 0 and 1.
The input parameter is only used when MARKET HILO is selected for > (ISL) Selection.
> (ISL) Market HiLo prominence
(IN_dIslMarketHiLoProminence)
0.025The input value has to be between 0 and 1.
The input parameter is only used when MARKET HILO is selected for > (ISL) Selection.
> (ISL) Market HiLo correction
(IN_dIslMarketHiLoCorrection)
1.0The input value cannot be smaller or equal to 0.
The input parameter is only used when MARKET HILO is selected for > (ISL) Selection.

Various input parameters can be used to adjust the MARKET HILO algorithm, each illustrated in the functional diagram below.

Configuration, Initial Stop Loss, Parameters for HiLo based initial stop loss, Function principle.png

The input parameters serve the following purposes:

  • > (ISL) Market HiLo range: This defines the bars within which a high or low can be searched.
  • > (ISL) Market HiLo min: This sets the minimum prominence a high or low must have to be valid as the value for the initial stop loss. The input is allowed to be between 0 and 1, representing 0% or 100% of the Market HiLo reference. The Market HiLo reference is the difference between the current price and the lowest price (for long trades) or the highest price (for short trades) within the range defined by the Market HiLo range.
  • > (ISL) Market HiLo max: This sets the maximum distance the local low or local high can be from the opening price. The Market HiLo reference is also used for these parameters as a reference. The parameter can be between 0 and 1, representing 0% or 100%.
  • > (ISL) Market HiLo prominence: The prominence parameter defines the minimum significance required between local lows and local highs to qualify for a valid low or high detection. Similar to the min and max values, it can range between 0 and 1, representing 0% or 100% of the Market HiLo reference.
  • > (ISL) Market HiLo correction: This value can be used to fine-tune the final selected initial stop loss value. If the value is smaller than one, the initial stop loss moves closer to the current price. If the value is greater, the stop loss moves away from the current price.

Please refer to the examples below, which demonstrate some setups for the Market HiLo initial stop loss selection.

Configuration, Initial Stop Loss, Parameters for HiLo based initial stop loss, Example charts.png
tip

To reproduce the chart from above, you can download and use the SET file package um_eab_cisl_15_v_2_0.zip.