Skip to main content
Version: 2.0

Example

This page provides an example of configuring the indicator engine, including all six indicator submodules. The configuration process is carried out step-by-step, utilizing certain indicator submodules to generate trading signals, while others are used as trend filters. All chart examples provided can be easily replicated using the example packages offered. Alternatively, all necessary changes to the input parameters can be located in the illustration captions provided in the chart examples.

Concept diagram

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

Indicators, Example, Concept diagram.png

Reset of inputs

Locate the Expert Advisor Builder application in the dropdown menu of the strategy tester settings under FEA Trading\MT4\Expert Advisor Builder 2.0 if you're using a MetaTrader 4 instance or FEA Trading\MT5\Expert Advisor Builder 2.0 if you're using a MetaTrader 5 instance. You can replicate the entire example in minutes by following the steps outlined in this article. To begin, kindly reset the strategy tester input as indicated.

Indicators, Example, Reset of inputs.png

The default input parameters of the Expert Advisor Builder are designed to be highly functional. This implies that not every parameter needs to be adjusted when creating a new strategy. Instead, only the differences from the default parameters need to be considered. As a result, even with minimal reconfiguration, the output strategy can be significantly different.

INA1

The indicator submodules INA1, INA2, INB1, and INB2 are utilized to calculate indicator values, display them on the chart, and evaluate them as independent signal generators. Meanwhile, INA and INB can combine the outputs of the previous four submodules to generate signals involving multiple indicator lines. The submodule you will learn to configure in this section is highlighted in green in the subsequent diagram.

Indicators, Example, INA0, Concept diagram, Block details.png

For a detailed explanation of the usage and configuration of each input parameter, please refer to the configuration article. All input parameters associated with the Indicator A1 submodules are grouped under the (INA1) identifier and can be found in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INA1) CONF, Signal in use
(IN_enmIna1SignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INA1) CONF, Signal visualization
(IN_enmIna1SignalVisualization)
OFF
> (INA1) CONF, Draw in chart
(IN_enmIna1DrawInChart)
ON
> (INA1) CONF, Selection
(IN_enmIna1Selection)
SMA - Simple Moving Average
> (INA1) CONF, Symbol
(IN_strIna1Symbol)
CURRENT
> (INA1) CONF, Exclusion (HH:MM:SS-HH:MM:SS)
(IN_strIna1Exclusion)
00:00:00-00:00:00
> (INA1) CONF, Timeframe
(IN_enmIna1Timeframe)
CURRENT
> (INA1) CONF, Series
(IN_enmIna1Series)
OPEN
> (INA1) CONF, Shift
(IN_nIna1Shift)
0
> (INA1) CONF, Line index
(IN_nIna1LineIndex)
0
> (INA1) CONF, Parameter 1
(IN_dIna1Parameter1)
0.0
> (INA1) CONF, Parameter 2
(IN_dIna1Parameter2)
0.0
> (INA1) CONF, Parameter 3
(IN_dIna1Parameter3)
0.0
> (INA1) CONF, Parameter 4
(IN_dIna1Parameter4)
0.0
> (INA1) CONF, Parameter 5
(IN_dIna1Parameter5)
0.0
> (INA1) CONF, Parameter 6
(IN_dIna1Parameter6)
0.0
> (INA1) COND, Angle limit condition
(IN_enmIna1AngleCondition)
OFF
> (INA1) COND, Angle limit 1
(IN_dIna1AngleLimit1)
0.0
> (INA1) COND, Angle limit 2
(IN_dIna1AngleLimit2)
0.0
> (INA1) COND, Value limit condition
(IN_enmIna1ValueCondition)
OFF
> (INA1) COND, Value limit 1
(IN_dIna1ValueLimit1)
0.0
> (INA1) COND, Value limit 2
(IN_dIna1ValueLimit2)
0.0

This particular submodule is designed to use an EMA indicator line as a trend filter. Trend filters can be implemented using a broad period in the native timeframe or selecting a higher timeframe for the submodule. In this example, trades are intended to be placed in the H15 timeframe, and the trend filter will utilize the H4 timeframe. Please refer to the illustration below to understand how to configure each input parameter to achieve the same output chart.

Indicators, Example, INA0, Example chart.png
tip

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

As observed, this configuration constantly evaluates the trading signal as positive. Additional indicator submodules are necessary to limit the number of trading signals.

INA2

Next, the submodule INA2 will be configured. It is also highlighted in the following diagram.

Indicators, Example, INA2, Concept diagram, Block details.png

For a comprehensive understanding of the usage and setup of each input parameter, please consult the configuration article. All input parameters related to the Indicator A2 submodules are categorized under the (INA2) identifier and are listed in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INA2) CONF, Signal in use
(IN_enmIna2SignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INA2) CONF, Signal visualization
(IN_enmIna2SignalVisualization)
OFF
> (INA2) CONF, Draw in chart
(IN_enmIna2DrawInChart)
ON
> (INA2) CONF, Selection
(IN_enmIna2Selection)
HMA - Hull Moving Average
> (INA2) CONF, Symbol
(IN_strIna2Symbol)
CURRENT
> (INA2) CONF, Exclusion (HH:MM:SS-HH:MM:SS)
(IN_strIna2Exclusion)
00:00:00-00:00:00
> (INA2) CONF, Timeframe
(IN_enmIna2Timeframe)
CURRENT
> (INA2) CONF, Series
(IN_enmIna2Series)
OPEN
> (INA2) CONF, Shift
(IN_nIna2Shift)
0
> (INA2) CONF, Line index
(IN_nIna2LineIndex)
0
> (INA2) CONF, Parameter 1
(IN_dIna2Parameter1)
0.0
> (INA2) CONF, Parameter 2
(IN_dIna2Parameter2)
0.0
> (INA2) CONF, Parameter 3
(IN_dIna2Parameter3)
0.0
> (INA2) CONF, Parameter 4
(IN_dIna2Parameter4)
0.0
> (INA2) CONF, Parameter 5
(IN_dIna2Parameter5)
0.0
> (INA2) CONF, Parameter 6
(IN_dIna2Parameter6)
0.0
> (INA2) COND, Angle limit condition
(IN_enmIna2AngleCondition)
OFF
> (INA2) COND, Angle limit 1
(IN_dIna2AngleLimit1)
0.0
> (INA2) COND, Angle limit 2
(IN_dIna2AngleLimit2)
0.0
> (INA2) COND, Value limit condition
(IN_enmIna2ValueCondition)
OFF
> (INA2) COND, Value limit 1
(IN_dIna2ValueLimit1)
0.0
> (INA2) COND, Value limit 2
(IN_dIna2ValueLimit2)
0.0

This submodule is configured to use an SMA indicator line as a trend filter. Unlike the EMA trend filter configured earlier, this indicator line operates on an H1 timeframe. Please refer to the illustration below for guidance on configuring each input parameter to replicate the output chart exactly.

Indicators, Example, INA2, Example chart.png
tip

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

As observed, two indicator lines are now displayed on the chart, and the overall trading signal remains consistently positive. The newly added SMA and the previously added EMA indicators are calculated based on the open price. Due to the less frequent updates of the open price in higher timeframes, the indicator lines appear stepped. This is by design.

INA

The subsequent step in the configuration process of the trend filter involves combining both trend indicator lines. This is achieved using the INA submodule. As the illustration below depicts, this function block receives the indicator values and angle information as input.

Indicators, Example, INA, Concept diagram, Block details.png

For a detailed understanding of the usage and configuration of each input parameter, please refer to the configuration article. All input parameters associated with the indicator A submodules are grouped under the (INA) identifier and can be found in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INA) CONF, Signal in use
(IN_enmInaSignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INA) CONF, Signal visualization
(IN_enmInaSignalVisualization)
OFF
> (INA) COND, Relation 1 INA1 to INA2
(IN_enmInaRelation1)
OFF
> (INA) COND, Relation 2 INA1 to INA2
(IN_enmInaRelation2)
OFF

The objective is to restrict positive signals to periods when the indicator value of the INA1 submodule exceeds that of INA2. By choosing VALUE 1 GREATER VALUE 2 as the required relational condition and activating the INA function block, the generated signal is confined to these periods.

Indicators, Example, INA, Example chart.png
tip

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

As can be seen in the accompanying chart above, the vertical signal lines are now limited. The combination of INA1 and INA2 currently serves as a trend filter. A trend filter is not intended to be used as a trading signal; it will only filter the actual trading signals usually generated in the native timeframe.

INB1

Next, you will configure the trading signals by setting up the submodules INB1, INB2, and INB, starting with INB1. The submodule you will learn to configure in this section is highlighted in green in the following diagram.

Indicators, Example, INB0, Concept diagram, Block details.png

For a detailed understanding of the usage and configuration of each input parameter, please refer to the configuration article. All input parameters associated with the Indicator B1 submodules are grouped under the (INB1) identifier and can be found in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INB1) CONF, Signal in use
(IN_enmInb1SignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INB1) CONF, Signal visualization
(IN_enmInb1SignalVisualization)
OFF
> (INB1) CONF, Draw in chart
(IN_enmInb1DrawInChart)
ON
> (INB1) CONF, Selection
(IN_enmInb1Selection)
EMA - Exponential Moving Average
> (INB1) CONF, Symbol
(IN_strInb1Symbol)
CURRENT
> (INB1) CONF, Exclusion (HH:MM:SS-HH:MM:SS)
(IN_strInb1Exclusion)
00:00:00-00:00:00
> (INB1) CONF, Timeframe
(IN_enmInb1Timeframe)
CURRENT
> (INB1) CONF, Series
(IN_enmInb1Series)
OPEN
> (INB1) CONF, Shift
(IN_nInb1Shift)
0
> (INB1) CONF, Line index
(IN_nInb1LineIndex)
0
> (INB1) CONF, Parameter 1
(IN_dInb1Parameter1)
0.0
> (INB1) CONF, Parameter 2
(IN_dInb1Parameter2)
0.0
> (INB1) CONF, Parameter 3
(IN_dInb1Parameter3)
0.0
> (INB1) CONF, Parameter 4
(IN_dInb1Parameter4)
0.0
> (INB1) CONF, Parameter 5
(IN_dInb1Parameter5)
0.0
> (INB1) CONF, Parameter 6
(IN_dInb1Parameter6)
0.0
> (INB1) COND, Angle limit condition
(IN_enmInb1AngleCondition)
OFF
> (INB1) COND, Angle limit 1
(IN_dInb1AngleLimit1)
0.0
> (INB1) COND, Angle limit 2
(IN_dInb1AngleLimit2)
0.0
> (INB1) COND, Value limit condition
(IN_enmInb1ValueCondition)
OFF
> (INB1) COND, Value limit 1
(IN_dInb1ValueLimit1)
0.0
> (INB1) COND, Value limit 2
(IN_dInb1ValueLimit2)
0.0

It's generally beneficial to output signals only from the indicator submodule that is currently in focus. Therefore, turn off the trend filter and configure the INB1 indicator line. The example chart below shows that the Signal in use input parameters for the INA1, INA2, and INA submodules are set to OFF. This excludes all the functional blocks from the signal generation logic, but the previous configurations of these modules are retained. It allows for a focused configuration of the INB1 indicator line.

The next module will use a Donchian Channel to generate signals in the native timeframe. This indicator will serve as a stand-alone signal generator and input for the INB indicator line combinator. However, let's begin with configuring the Donchian channel as a stand-alone signal. To do this, please refer to the list of input parameters below and adjust your strategy tester input parameters accordingly.

Indicators, Example, INB0, Example chart.png
tip

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

The signals the Donchian channel produces are only displayed when its angle is positive. This is configured by the input parameter > (INB1) COND, Angle limit condition. Additionally, the indicator uses the input parameters > (INB1) CONF, Parameter 1 to modify the default period used by the indicator algorithm. Remember to enable the INB1 indicator block with its input parameter > (INB1) CONF, Signal in use. As a consequence of this configuration, the positive trading signals are represented by brief periods, as indicated by the vertical green lines in the chart example above.

INB2

The last indicator line to be configured for this trading strategy is computed by the INB2 submodule. The submodule that will be configured in this section is highlighted in green in the diagram that follows.

Indicators, Example, INB2, Concept diagram, Block details.png

For an in-depth understanding of the usage and setup of each input parameter, please consult the configuration article. All input parameters related to the Indicator B2 submodules are categorized under the (INB2) identifier and are listed in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INB2) CONF, Signal in use
(IN_enmInb2SignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INB2) CONF, Signal visualization
(IN_enmInb2SignalVisualization)
OFF
> (INB2) CONF, Draw in chart
(IN_enmInb2DrawInChart)
ON
> (INB2) CONF, Selection
(IN_enmInb2Selection)
KAMA - Kaufman Moving Average
> (INB2) CONF, Symbol
(IN_strInb2Symbol)
CURRENT
> (INB2) CONF, Exclusion (HH:MM:SS-HH:MM:SS)
(IN_strInb2Exclusion)
00:00:00-00:00:00
> (INB2) CONF, Timeframe
(IN_enmInb2Timeframe)
CURRENT
> (INB2) CONF, Series
(IN_enmInb2Series)
OPEN
> (INB2) CONF, Shift
(IN_nInb2Shift)
0
> (INB2) CONF, Line index
(IN_nInb2LineIndex)
0
> (INB2) CONF, Parameter 1
(IN_dInb2Parameter1)
0.0
> (INB2) CONF, Parameter 2
(IN_dInb2Parameter2)
0.0
> (INB2) CONF, Parameter 3
(IN_dInb2Parameter3)
0.0
> (INB2) CONF, Parameter 4
(IN_dInb2Parameter4)
0.0
> (INB2) CONF, Parameter 5
(IN_dInb2Parameter5)
0.0
> (INB2) CONF, Parameter 6
(IN_dInb2Parameter6)
0.0
> (INB2) COND, Angle limit condition
(IN_enmInb2AngleCondition)
OFF
> (INB2) COND, Angle limit 1
(IN_dInb2AngleLimit1)
0.0
> (INB2) COND, Angle limit 2
(IN_dInb2AngleLimit2)
0.0
> (INB2) COND, Value limit condition
(IN_enmInb2ValueCondition)
OFF
> (INB2) COND, Value limit 1
(IN_dInb2ValueLimit1)
0.0
> (INB2) COND, Value limit 2
(IN_dInb2ValueLimit2)
0.0

The INB2 submodule directly uses the open price as its output value. Technically, this forwards the price but also enables us to evaluate it using the standard indicator logic. Additionally, the price line is shifted by three bars. A positive signal is generated only when the angle of the shifted price line is above zero. As depicted in the example chart below, the green indicator line represents the output of the submodule. The form of the line closely resembles the price itself, differing only by a shift of three bars.

Indicators, Example, INB2, Example chart.png
tip

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

Given its frequent directional changes, this indicator generates numerous stand-alone signals and is not an effective signal source. Therefore, let's integrate it with the previously configured Donchian channel.

INB

As previously stated, it's necessary to combine INB1 and INB2 to restrict the number of positive signals to a manageable level. For this purpose, we'll use the INB submodule. The diagram below shows that this function block receives the indicator values and angle information as input.

Indicators, Example, INB, Concept diagram, Block details.png

For an in-depth understanding of the usage and setup of each input parameter, please consult the configuration article. All input parameters related to the Indicator B submodules are categorized under the (INB) identifier and are listed in the table below.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INB) CONF, Signal in use
(IN_enmInbSignalInUse)
OFFThe configuration article explains the meaning and usage of each input parameter.
> (INB) CONF, Signal visualization
(IN_enmInbSignalVisualization)
OFF
> (INB) COND, Relation 1 INB1 to INB2
(IN_enmInbRelation1)
OFF
> (INB) COND, Relation 2 INB1 to INB2
(IN_enmInbRelation2)
OFF

The combined signal, derived from the indicator values INB1 and INB2, is illustrated in the example chart below. The number of trading signals is significantly reduced by using the relation ANGLE 1 GREATER ANGLE 2 as input parameters for > (INB) COND, Relation 1 INB1 to INB2.

Indicators, Example, INB, Example chart.png
tip

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

The final step involves combining all indicator submodules.

Final signal

Let's combine the signal generation in the native timeframe with the trend filter configured at the start of this article. To do this, please enable the Signal in use input option for INA1, INA2, INA, INB1, INB2, and INB. A complete list of the modified input parameters and the resulting chart output can be found below.

Indicators, Example, Final signal, Example charts 1.png
tip

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

As observed, the final signal is less frequent and indicates short-term upward movement, presenting a good opportunity for long trades. However, this is merely an example and purports to be something other than a fully functional and profitable trading strategy. Nonetheless, it can be a starting point for building a trading module based on the indicator functional block.

When executing the trading strategy with the Custom Expert Advisor, you should maintain a clean chart window without numerous indicator lines. To achieve this, you can turn off the drawing of the indicator lines using the input parameters that contain the text Draw in chart. This will result in a clean chart displaying the trading signals as vertical green lines.

Indicators, Example, Final signal, Example charts 2.png
tip

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

These vertical green lines are a result of the input parameters > (ORM) Operation and > (MIS) General signal visualization. Please adjust these input parameters accordingly to enable the trading module to open long trades whenever a trading signal occurs. You will then notice that long trades are initiated instead of indicating the trading signals. This article does not focus on configuring the stop loss and taking profit levels. For information on that, please refer to the relevant user manual article.

Indicators, Example, Final signal, Example charts 3.png
tip

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

Although you have configured the final signal with the assumption of executing long trades, it is also straightforward to test the same signal with short trades. Change the input parameter > (ORM) Operation from LONG to SHORT to do this.

Indicators, Example, Final signal, Example charts 4.png
tip

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