• Overview
  • Reviews (2)
  • Comments (52)
  • What's new


The EA allows creating a trading system based on a custom indicator. The trading robot automatically opens/closes trades by signals of the indicator that places the values not equal to 0 and EMPTY_VALUE to the buffer. The EA checks the values of the specified indicator buffers, as well as opens/closes and tracks deals according to specified parameters.

The trading robot features the following deal-tracking functions:

  • setting stop loss and take profit by specified parameters or indicator data;
  • calculating order volume by specified risk per deal;
  • moving to breakeven (moving stop loss to the level providing the minimum profit value when the price passes the specified value);
  • partial position closing (closing the specified volume part when the price passes the specified value);
  • increasing a deal volume after receiving a loss;
  • closing all orders by a total profit value.

The EA verifies sufficiency of free funds before opening a new deal, manages TP and SL levels, and checks order execution modes. The settings contain parameters for working on accounts with 4-digit quotes. For accounts with 5-digit quotes, the values are re-calculated automatically.

To implement your own indicator, enter its name (file name with no extension or path) and set applied buffers. The indicator should be compiled and placed in the standard application folder.

The EA resources already have a test indicator allowing you to check the performance in the strategy tester. To use it, enter the following value for the IndicatorName parameter ::Indicators\\TestIndicator.ex4 (default setting).


  • startLot - initial volume when setting a fixed value;
  • maxLot - maximum deal volume when calculating by risk or multiplying;
  • MaxRisk - maximum risk per deal (define order volume by maximum loss in % of the deposit), does not work in case of zero stopLoss, cancels startLot usage, 0 - not used;
  • Martin_factor - multiplication factor of a new order volume after a loss (0 - not used);
  • stepProfit - profit step in points for partial deal closing (0 - not used);
  • stepProfit_factor - volume in case of partial order closing (0 - not used);
  • stopLoss - stop loss in points (0 - not used);
  • takeProfit - take profit in points (0 - not used);
  • noLoss - level for moving to breakeven in points (0 - not used);
  • noLoss_factor - level for moving to breakeven in fractions of SL (0 - not used);
  • trailStop - trailing in points (0 - not used);
  • trailStep - trailing step in points (0 - not used);
  • DualOrders - allow opening sell orders when active buy deals are present and vice versa;
  • UseAllSignals - allow orders by all signals;
  • ProfitNum - minimum number of orders for closing by total profit;
  • ProfitSumm - profit value to close orders;
  • IndicatorName - indicator name (with no extension or path);
  • openBuyBufferIndex - buffer for opening buy orders (-1 - not used);
  • takeProfitBuyBufferIndex - buffer of take profit values for buy orders (-1 - not used);
  • stopLossBuyBufferIndex - buffer of stop loss values for buy orders (-1 - not used);
  • closeBuyBufferIndex - buffer for closing buy orders (-1 - not used);
  • openSellBufferIndex - buffer for opening sell orders (-1 - not used);
  • takeProfitSellBufferIndex - buffer of take profit values for sell orders (-1 - not used);
  • stopLossSellBufferIndex - buffer of stop loss values for sell orders (-1 - not used);
  • closeSellBufferIndex - buffer for closing sell orders (-1 - not used);
  • BarIndex - bar index in a buffer;
  • useMaFilter - enable MA based filtering of signals;
  • MaFilterTimeFreme - timeframe of the Moving Average;
  • MaFilterPeriod - period of the Moving Average;
  • MaFilterMethot - method of the Moving Average;
  • MaFilterPrice - prices of the Moving Average;
  • CustomEventBuy - custom buy event (0 - not used)
  • CustomEventSell - custom sell event (0 - not used)
  • timeStart - trading start hour (0 .. 23);
  • timeEnd - trading end hour (0 .. 23);
  • slippage - slippage in points;
  • MAGIC - identifier;
  • useMail - enable sending email messages;
  • useNotification - enable sending push-notifications;
  • messageText - message text;
  • TesterAutoTradeWeek - enable weekly automatic buy signal in the strategy tester.
2018.04.18 00:32 

This is AMAZING work. This is genius, both for the idea and implementation.

I have been able to backtest a large numbers of indicator to assess which ones were the best suited for my market and strategy. Huge time and money saver.

Thank you for this wonderful work.

Michael Maggi
2016.12.28 14:37 

Starting off well for 2017 preparation. I will post more on my profile page to show the trading specifics but the Universal EA definitely does what it promises. I will add a comment with a jpg.

Version 1.17 - 2018.05.08
Added a signal for partial closing of deals.
Version 1.16 - 2018.05.03
Added filters based on signals of indicators: RSI, Stohastic, SAR, StdDev, MACD
Version 1.8 - 2016.12.19
Added handling of the custom chart events:
- CustomEventBuy
- CustomEventSell
Added the TesterAutoTradeWeek parameter for the automatic validation of the EA on mql5. In testing mode, the EA automatically generates buy events 1 time per week.
Version 1.5 - 2016.06.21
Added filter of trades based on the Moving Average. If the price is above MA, only Buy trades can be performed. If the price is below MA, only Sell trades are executed.
Filter parameters:
-useMaFilter - enable MA based filtering of signals;
-MaFilterTimeFrafe - timeframe of the Moving Average;
-MaFilterPeriod - period of the Moving Average;
-MaFilterMethod - method of the Moving Average;
-MaFilterPrice - prices of the Moving Average.
Version 1.3 - 2016.06.07
- Minor improvements
- Added email and mobile notifications