Trade Designer TradeBuilderMT5 is an adviser designed to build trading systems based on arbitrary sets of technical indicators.
The EA's work is based on the formation and processing of the following signals:
- OpenBuy / OpenSell - opening positions;
- StopBuy / StopSell - closing positions;
- TakeProfitBuy / TakeProfitSell - getting TP levels;
- StopLossBuy / StopLossSell - getting SL levels;
- NoLossBuy / NoLossSell - transfer to breakeven;
- MinProfitBuy / MinProfitSell - closing part of a position;
- CancelBuy / CancelSell - permission of a repeated signal for opening;
- DeleteBuy / DeleteSell - delete pending orders.
Signals are formed from several consecutive steps (for Open - 10 steps, for the rest - 2 steps), specified through input parameters. Each step contains the following fields:
- indicator (drop-down list) - selects an indicator from the MT5 list, including CUSTOM, as well as optionally Open, Close, High, Low prices, current Bid and Ask prices, the lowest Low and the highest High of the specified interval (Lowest, Highest);
- tf (drop-down list) - select a time period;
- action (drop-down list) - step function;
- param - parameter string separated by commas (for the CUSTOM indicator, the first parameter should be a string with the indicator name);
- bar - bar index;
- line - buffer index;
- arg - step argument (double);
- freeze - a sign of storing the result of a step for a given number of bars
In the input parameters, the name of the steps is encoded with delimited text: <signal name> _ <step> _ <parameter>, for example, OpenBuySignal_0_indicator - a parameter that sets the type of indicator for step 0 of the OpenBuy signal.
Each step has a result of execution (true / false) and a value used for further processing. A list of functions with a description is given in the table below.
Function | Description |
---|---|
EmptyAction | Empty action (used, for example, to get the indicator value at a certain point). The result of the function is always true. |
Above | Comparison of the value obtained in the current step with the previous one. If the value of the current step is higher than the previous one, then the result is true, otherwise false. |
Below | Comparison of the value obtained in the current step with the previous one. If the value of the current step is lower than the previous one, then the result is true, otherwise false. |
Abovearg | Comparison of the value obtained in the current step with the value specified in the arg field. If the value of the current step is higher than the specified one, then the result is true, otherwise false. |
Belowarg | Comparison of the value obtained in the current step with the value specified in the arg field. If the value of the current step is lower than the specified one, then the result is true, otherwise false. |
Addpoint | Adding to the value obtained at the current step the number of points specified in the arg field. The result of the function is always true. |
Empty | Checks the value obtained in the current step from 0 or EMPTY_VALUE. The result of the execution is set to true when the current step is zero. |
Notempty | Checks the value obtained in the current step from 0 or EMPTY_VALUE. The execution result is set to true if the current step is nonzero. |
Crossup | Checking the intersection of the indicator lines defined in the current and previous step up. The result is set to true when the new point of the indicator specified in the current step is higher than the previous one, and past points are vice versa. |
Crossdown | Checking the downward intersection of the indicator lines specified in the current and previous step. The result is set to true when the new point of the indicator specified in the current step is lower than the previous one, and past points are vice versa. |
MoveUp | Checking the movement of the line specified in the current step up. The result is set to true when the new indicator point is higher than the previous one. |
Movedown | Checking the movement of the line specified in the current step down. The result is set to true when the new indicator point is lower than the previous one. |
CrossArgUp | Checks if the line crosses up the value specified in the arg parameter. The result is set to true when the condition is met. |
Crossarggown | Checks if the line crosses down the value specified in the arg parameter. The result is set to true when the condition is met. |
Equalarg | Checks the value for equality specified in the arg parameter. The result is set to true when the condition is met. |
NotEqualArg | Check the value for the inequality specified in the arg parameter. The result is set to true if inequality occurs. |
Equal | Check for equality of values of the current and previous steps. The result is set to true when the condition is met. |
Notequal | Check for equality of values of the current and previous steps. The result is set to true if inequality occurs. |
AddToPrice | The indicator value is added to the current price. The multiplier specified in the arg field is used. It can be used, for example, to calculate the SL or TP level from the ATR value. |
The signal returns true, if received on each function of the signal.
The following is an example of signal setup when moving averages are moving upwards with periods of 10 and 20. The numbers in the screenshot indicate:
- MA indicator selected
- current time frame
- empty action
- MA parameters
- bar 1
- line 0
- MA indicator in the next step
- intersection function
- parameters of the second MA
- EmptyIndicator in the next step - a sign of the end of the signal
To determine the parameter string, you need to refer to the documentation on mql5 technical indicators . Here, choosing the required indicator, we will get a description, such as below 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 );
It is necessary to enter the numerical values of all parameters, except symbol and period, separated by commas. In this case, there are 4 parameters for the MA indicator. Below are the default parameter lines for each indicator and line numbers.
Indicator | Parameter String | Line numbers, comment |
---|---|---|
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,3,0,0,0 | |
Ao | ||
ATR | 14 | |
Bands | 20,0,2.0,0 | 0 - BASE_LINE, 1 - UPPER_BAND, 2 - LOWER_BAND |
BEARS | thirteen | |
BULLS | thirteen | |
Bwmfi | 0 | |
CCI | 14.5 | |
CHAIKIN | 3,10,1,0 | |
Custom | indicator_name *** | |
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- color of the lower histogram |
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 | |
BITMAP, TREND TEXT |
Checking the graphic object OBJ_BITMAP, OBJ_TREND, OBJ_TEXT at the position specified in the bar. | |
Btn_BUY, Btn_SELL, Btn_CloseBUY, Btn_CloseSELL |
Opening buy / sell deals or closing them by clicking on the corresponding button (the adviser places the buttons on the chart itself). |
*** Custom indicator CUSTOM as parameters must contain at least one parameter - its name. All parameters are entered in one line, with a separator - a comma. The Expert Advisor extracts values of the following types from a string: string (framed by single quotes); int (contains only the characters 0..9); double (characters 0..9 and period); bool (true or false). Other types of parameters should be converted to the listed formats.
An example of setting a signal on a custom indicator from the market is shown in the screenshot below.
Below is an example of the configuration of the StopLossBuy signal to obtain the SL level at the lowest price value for the last 6 bars. The numbers in the screenshot indicate:
- Lowest indicator selected
- start bar
- bar counter
- EmptyIndicator, as a sign of signal completion
The list of parameters for setting up trading:
- startLot - fixed volume of transactions;
- riskPercent - percentage for calculating the volume of the balance of available funds (with non-zero SL);
- takeProfit - fixed TP;
- takeProfit_factor - calculate TP but SL level
- stopLoss - fixed SL;
- noLoss - fixed level of breakeven;
- noLoss_factor - level of transfer to breakeven as a percentage of available funds;
- minProfit - fixed level of partial closure;
- minProfit_percent - level of partial closure as a percentage of available funds;
- minProfit_factor - partial close size
- trailStop - fixed level of trailing;
- trailStop_factor - trailing level from TP level;
- trailStep - trailing step;
- numOrders - the number of transactions in one direction;
- bothOrdersDir - permission of Buy deals in the presence of Sell and vice versa;
- GridDistance - the minimum distance between grid orders;
- GridFactor - coefficient of change in grid volume;
- autoGrid - permission to automatically open deals;
- useVirtual_SL_TP, color_SL, color_TP - use virtual SL and TP, line colors;
- AverageClose_percent, AverageClose_price - percentage and closing amount of unidirectional transactions;
- DiffClose_percent, DiffClose_price - percentage and closing amount of multidirectional transactions;
- martin_factor - coefficient of volume change after loss;
- tradeMon, tradeTue, tradeWed, tradeThu, tradeFri - trading time by day of the week;
- orderTypes - type of open orders (market, limit, stop).