Auto SL TP Expert Advisor For MT4
WE IMPROVED THIS EXPERT ADVISOR FOR YOU!!!
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:
- Auto SL TP Expert Advisor For MT4
- The Auto SL TP Expert Advisor For MT4 – Entry Criteria
- The Auto SL TP Expert Advisor For MT4 – Exit Criteria
- The Auto SL TP Expert Advisor For MT4 – Room for Improvement
The Auto SL TP Expert Advisor For MT4, by the name itself, is a manual trading tool that automatically sets the stop loss and take profit of trades manually opened by the trader. Although the user is given an option to apply the robot to either the active symbol or all pairs in the trading account as defined in Inputs, the expert advisor seems to work on the active symbol only in the actual practice. The second option (i.e., all pairs) is the default setting for trade management.
There are certain conditions that must be satisfied before the robot performs the trade adjustment process. First, the trade should have no magic number, meaning the trade is opened manually or it is opened by another expert advisor with a magic number of zero. Next, the trade should have no take profit. This means that the trade adjustment will be done by the robot only once for each trade. Also, the trade should have been open for at most one minute. Beyond one minute, the robot will not adjust the stop loss and take profit.
The Auto SL TP Expert Advisor For MT4 – Entry Criteria
The Auto SL TP Expert Advisor performs its function on every tick if such is possible. It loops through the orders in the trade pool every time a tick is received and checks if trade adjustment can be done. If not, it exits the start function and returns the command to the terminal until the next tick comes in.
There are very few options given to the user in Inputs that he can manipulate at will. These variables are self-explanatory, but the user can get more information from the listing below:
- AllPairs = True – Since this variable is true, the expert advisor will consider trades not executed on the current symbol as long as they have no magic numbers and no take profit values. By default, the robot covers all trades in the trading account. If set to false, the robot will handle trades opened in the current symbol only.
- TakeProfit = 400 – This value is in points. This means that the take profit of trades will be placed 400 points (or 40 pips) from the entry price.
- StopLoss = 150 – This value is in points. This means that the stop loss of trades will be placed 150 points (or 15 pips) from the open price.
- DurasiTime = 60 – This value is in seconds. This variable refers to the age of the trade from the time of entry. The trade should be running for not more than 60 seconds (or one minute) so that the robot will apply the trade adjustment.
To make the expert advisor perform its function, the user must click on both the Allow Sell and Allow Buy buttons on the upper-right portion of the main window. Next, he can open the manual trades and let the robot set the stop loss and take profit based on the values declared in Inputs. While it sounds like the robot can handle trade management for trades in other symbols, this is not true at all in the actual scenario.
When determining the stop loss and take profit values, the expert advisor takes the stop level of the applicable symbol into consideration. If the stop loss amount set in Inputs is greater than the stop level, the robot will take that stop loss value. If the stop loss amount declared in Inputs is smaller than the stop level, the robot will use the stop level amount as the stop loss value.
The robot handles the take profit in the same manner as for the stop loss. If the take profit amount set in Inputs is greater than the stop level, the robot will take that take profit value. If the take profit amount declared in Inputs is smaller than the stop level, the robot will use the stop level amount as the take profit value.
The actual process of stop loss and take profit adjustment is done in the following way. For a buy trade, the stop loss is placed 15 pips (or stop pips) below the open price, and the take profit is put 40 pips (or stop pips) above the open price. For a sell trade, the stop loss is put 15 pips (or stop value pips) above the entry price, and the take profit is placed 40 pips (or stop value pips) below the entry price.
However, the user must be aware that trade adjustment applies not only to market orders, but also to pending orders. As laid down in the foregoing paragraph, the stop loss and take profit adjustment for buy positions is done in a similar manner for buy limit and buy stop orders. The same process is also applied to the sell, sell limit and sell stop orders. Only the take profit and stop loss are adjusted for all trade types. The pending order open price is not modified.
The Auto SL TP Expert Advisor For MT4 – Exit Criteria
The Auto SL TP Expert Advisor does not actively take part in the closing of trades. Once it has adjusted the stop loss and take profit of trades, its job is done. It gives the market full control to determine the fate of every trade. Breakeven, stop trailing and forced closure when an opposite signal comes are not performed by this expert advisor.
The Auto SL TP Expert Advisor For MT4 – Room for Improvement
The Auto SL TP Expert Advisor is a very simple expert advisor for MetaTrader4. Other than the function discussed in the foregoing paragraphs, the robot does not perform any more functions. One issue with this expert advisor is the possible bug in managing trades from other symbols. In fact, the robot does not carry out the order modification of trades from other charts while this has been explicitly defined and enabled by default in Inputs. The code must be reviewed and updated to address this concern.
Updating the code is the only way to make the robot more useful. If this issue is not taken care of, the program would better do as a script than an expert advisor. On the other hand, it is not possible to convert this program into a technical indicator for the very reason that indicators do not perform trade operations such as order modification.
The expert advisor can work better and more effectively if it hides the stop loss and take profit values of trades. This means that the robot does not actually place the stop loss and take profit by sending an order request to the trade server. What it can do is remember the values of the stop loss and take profit for each trade and wait for price to come to either of these prices. If price hits the stop loss first, the trade ends in loss, but if price hits the take profit first, the trade ends in profit.
The advantage of not placing the orders on the chart is to prevent the broker from seeing the limits of each trade. These parameters are very important to brokers in their counter measures against inexperienced traders. It is common knowledge that brokers trade against their clients and play dirty tricks to amass money from retail traders. If the stop loss and take profit are hidden, horizontal lines should be placed on the chart so that the trader will know exactly where these values are situated with respect to the open price.