Trailing Master Expert Advisor For MT4

Trailing Master Expert Advisor For MT4



PLEASE NOTE: This expert advisor was publicly available for free usage on other websites and is not programmed by us. We explain the functionality and possible improvements of the EA. Furthermore, we are convinced that fully automatic Expert Advisors will fail in the long run. On the other hand, our semi-automatic approach with detecting the best setups and then activating our Expert Advisors (e.g. V-Power EA, EdgeZone EA) produced many successful traders and some of them even got prop traders at prop trading firms. Therefore, we added a similar semi-automatic trading feature (to allow only buy or only sell trades) to the free Expert Advisors. You can download the modified version here and enjoy!


Table Of Contents:

  1. Trailing Master Expert Advisor For MT4
  2. The Trailing Master Expert Advisor For MT4 – Entry Criteria
  3. The Trailing Master Expert Advisor For MT4 – Exit Criteria
  4. The Trailing Master Expert Advisor For MT4 – Room for Improvement


The Trailing Master Expert Advisor For MT4 is a simple program written in MQL4 language designed to be used in MT4 platform. It is not the normal type of expert advisor familiar to most traders. Unlike the majority of expert advisor available online, this robot does not take trades on its own. It is not designed for that purpose. It is simply a tool for trading. What it does is manage open trades on a trading account. Despite this limited function, this program still belongs to the category of expert advisors, and no other type of program (i.e., script or technical indicator) can perform its function.

As a trade management tool, this robot’s performance cannot be tested via the strategy tester as it requires previously open trades executed manually or automatically by other trading systems. However, it will not perform its role as a trade management tool if the user does not specifically give such order. The user must manually indicate in Inputs the magic number that the robot will monitor before it starts working. However, since no two expert advisors can work simultaneously in one chart, the Trailing Master must take the place of any robot attached to the chart if there is one currently. Alternatively, the user can open another chart of the same symbol and run the Trailing Master there. In the second case, the two robots can run side by side.

FREE Trailing Master EA

Download the FREE Trailing Master Expert Advisor for MT4.

To receive my email 100% sure: 
Put my email on your whitelist!

The Trailing Master Expert Advisor For MT4 – Entry Criteria

As already mentioned, the Trailing Master Expert Advisor for MT4 does not open trades, so it does not look into any trade entry requirements. In terms of scope, the program has very limited sphere of influence. It only controls the trades on the current symbol. It does not look at trades open in other symbols. If that is desired, the user can attach instances of the Trailing Master to other symbols of his choosing. However, the program works in trading accounts whose exchange rates are expressed in five or four digits for USD pairs and in three or two decimals for JPY pairs.

Other parameters must be set in place for the Trailing Master to work as intended. The user must ensure that the TrailingStop parameter in Inputs has some value. By all means, it has to be greater than zero. The default value is 50 pips. The Trailing Master will behave differently depending on the values of the two logical conditions given in Inputs that are selected by the user. These conditions have something to do with order comment and order magic number. The user can set both conditions to true or false, or it can leave one condition to true and the other to false and vice versa.

The Trailing Master Expert Advisor For MT4 – Exit Criteria

Once the user sets the parameters in place and the Trailing Master Expert Advisor for MT4 is dropped on the chart, it starts working immediately by the tick. It does not wait for a new candle to form before taking action. As a new tick comes in, a series of tests is being performed before the actual trade management action is taken.

The robot cycles through the orders in the trade pool to see if there is an open trade (buy or sell). Pending orders are not considered. If the trade is executed on the current symbol, the running profit is greater than zero (without regard to the swap and commission), the magic number is the same as the value in Inputs, the order comment is equal to the comment set by the user in Inputs, and whether either or both of the two logical conditions are enabled, the robot will perform the succeeding actions. Based on the selected conditions and settings in Inputs, the robot will take one path out of eight choices before doing the last action, that is, to adjust the stop loss of the currently selected trade.

For example, in one iteration of the loop, if the comment and magic number conditions are set to true, and the order comment and magic number are the same as those in Inputs, the robot will check one last condition before modifying the stop loss. For a buy trade, the distance between market price (i.e., bid price) and the order open price must be greater than 50 pips and the stop loss must be below the open price. If this is true, the robot will move the stop loss to the entry price for the first time.

Thereafter, if the market continues to move up and the distance between the bid price and the stop loss is greater than 50 pips, the robot again adjusts the stop loss higher to lock in more profits. This will continue until price hits either the adjusted stop loss or take profit, assuming the trade has a take profit stop order in place. At any point in this scenario, the robot will maintain a distance of 50 pips between the bid price and stop loss price.

The Trailing Master Expert Advisor For MT4 – Room for Improvement

Currently, it is not possible to check if the Trailing Master Expert Advisor for MT4 works as intended because it does not take any action in the strategy tester. Only demo trading can tell if the robot is working or not. While the program code looks fine, errors might show up or bugs might be detected when the robot is run using live market data.

If possible, a function must be added in the code that allows the robot to take trades in testing mode so that the user can see how it works in action. A few lines of code added to the program are enough to have this function. At the moment it is best if the robot is used by traders familiar with the MT4 platform and knowledgeable of MQL4 programming. If the user does not understand yet the concept of magic number and comment as it relates to trading, he is better off using another more complete trading system.

In MT4, to see the comment on every trade if such comment is available, the user must manually display the Comments column under the Trade tab in the terminal window. The magic number of any trade can be seen as a tooltip when the user hovers the mouse over an item in the Comments column. If the trade is opened manually by the trader, no magic number is shown by this method.


FREE Trailing Master EA

Download the FREE Trailing Master Expert Advisor for MT4.

To receive my email 100% sure: 
Put my email on your whitelist!


Partially Automated Trading Besides Your Day Job

Alerts In Real-Time When Divergences Occur

My Recommended MT4/MT5 Broker

About Me

I'm Mike Semlitsch the owner of My trading career started in 2007. Since 2013 I have helped thousands of traders to take their trading to the next level. Many of them are now constantly profitable traders. 

The following performance was achieved by me while trading live in front of hundreds of my clients:

Connect With Me:  

Results From 5 Months!
This service starts soon! Be the first who get's notified when it begins!

This FREE Indicator Can Transform
Your Trading!

FREE Indicator + Telegram Group

Request the Ultimate Double Top/Bottom Indicator which is used by 10,000+ traders.