The TradeBuilderMT5 Expert Advisor is designed to build a trading system based on an arbitrary set of technical MT5 indicators.
Previous article: Using CancelBuy and CancelSell Signals
Configuring the use of technical indicators is made by selecting them from the drop-down list and configuration parameters:
- indicator selection
- time interval
- parameter string
- chart bar (0-current bar, 1-last closed bar, etc.)
- line graphics.
The most critical is the indicator parameter string. If the line does not have at least one parameter, the indicator is initialized with an error and we get the following in the log:
Naturally, the signal with such an error will not work. To determine the parameter string, refer to the mql5 technical indicators documentation. Here, choosing the required indicator, we get a description, such as the following:
int iMA( string symbol, // имя символа ENUM_TIMEFRAMES period, // период int ma_period, // период усреднения int ma_shift, // смещение индикатора по горизонтали ENUM_MA_METHOD ma_method, // тип сглаживания ENUM_APPLIED_PRICE applied_price // тип цены или handle );
We must enter a comma-separated number of all parameters, except symbol and period. In this case, for the indicator MA - 4 parameters.
Below are the default parameter lines for each indicator and line numbers.
Индикатор | Строка параметров | Номера линий |
---|---|---|
AC | ||
AD | ||
ADX | 14 | 0 - MAIN_LINE, 1 - PLUSDI_LINE, 2 - MINUSDI_LINE |
ADXW | 14 | 0 - MAIN_LINE, 1 - PLUSDI_LINE, 2 - MINUSDI_LINE |
ALLIGATOR | 13,8,8,5,5,3,2,4 | 0 - GATORJAW_LINE, 1 - GATORTEETH_LINE, 2 - GATORLIPS_LINE |
AMA | 15,2,30,0,0 | |
AO | ||
ATR | 14 | |
BANDS | 20,0,2.0,0 | 0 - BASE_LINE, 1 - UPPER_BAND, 2 - LOWER_BAND |
BEARS | 13 | |
BULLS | 13 | |
BWMFI | 0 | |
CCI | 14,5 | |
CHAIKIN | 3,10,1,0 | |
CUSTOM | имя_индикатора *** | |
DEMA | 14,0,0 | |
DEMARKER | 14 | |
ENVELOPES | 14,0,0,0,0.1 | 0 - UPPER_LINE, 1 - LOWER_LINE |
FORCE | 13,0,0 | |
FRACTALS | 0 - UPPER_LINE, 1 - LOWER_LINE | |
FRAMA | 14,0,0 | |
GATOR | 13,8,8,5,5,3,2,4 | 0 - UPPER_HISTOGRAM, 1- color of the upper histogram, 2 - LOWER_HISTOGRAM, 3- bottom histogram color |
ICHIMOKU | 9,26,52 | 0 - TENKANSEN_LINE, 1 - KIJUNSEN_LINE, 2 - SENKOUSPANA_LINE, 3 - SENKOUSPANB_LINE, 4 - CHIKOUSPAN_LINE |
MA | 10,0,0,0 | |
MACD | 12,26,9,0 | 0 - MAIN_LINE, 1 - SIGNAL_LINE |
MFI | 14,0 | |
MOMENTUM | 14,0 | |
OBV | 0 | |
OSMA | 12,26,9,0 | |
RSI | 14,0 | |
RVI | 10 | |
SAR | 0.02,0.2 | |
STDDEV | 20,0,0,0 | |
STOCHASTIC | 5,3,3,0,0 | 0 - MAIN_LINE, 1 - SIGNAL_LINE |
TEMA | 14,0,0 | |
TRIX | 14,0 | |
VIDYA | 15,12,0,0 | |
VOLUMES | 0 |
*** A custom indicator CUSTOM as parameters must contain at least one parameter - its name. In accordance with the rules of TradeBuilderMT5, this parameter must be framed with single quotes.
In the next article we will look at the use of a custom indicator in TradeBuilderMT5.