Automatically Enable Or Disable The Automated Trading Button 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:
- Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4
- The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Entry Criteria
- The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Exit Criteria
- The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Suggestion for Improvement
The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 is a simple program for MetaTrader4 platform that works exactly how it is named. It is not an algorithmic trading system per se as it does not open and manage trades on behalf of the trader. It performs only one function, that is, toggling the Auto Trading button on and off in MT4.
When dropped on a chart, the robot checks the current hour on the broker side and determines if it is within the time period set by the user in Inputs. In the example depicted in the photo above, the server hour is 11 while the trading schedule starts at hour 1 and ends at hour 10. This means that the time hour is outside of the trading schedule range. As a result, the robot turns off the Auto Trading button.
An expert advisor with a function as simple as this does not need to be tested in the back tester. What the user needs to do is to drop the program on any chart using a demo account. The program works as designed, and it can be immediately run even on a live account should the user find it needed. In this example, the robot turns off the Auto Trading function. Later in this article, the reader will see an example of the program turning on this function.
The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Entry Criteria
The Automatically Enable or Disable the Automated Trading Button Expert Advisor is a simple tool that users might find useful in their trading when using an automated trading system. If in case the user is using a trading system that does not include a filter for trading schedule and he wants to trade within a specific time period or market session based on the broker’s time, he can run this expert advisor alongside the other robot by putting this program in another chart. As an expert advisor itself, the robot cannot sit side by side without another robot. Only one robot is allowed by the MT4 terminal to run in one chart.
As already discussed, the expert advisor turns auto trading on and off based on the current time of the day on the server side. When the current hour is outside the trading schedule defined by the user in Inputs, the robot will disable the auto trading feature in case it was enabled previously. The result is that any other expert advisor in the trading account cannot run its algorithm.
When the current hour is within the defined trading schedule in Inputs, the robot will enable the auto trading feature in case it was disabled previously. At this time, any expert advisor running in the client terminal can perform its operations based on its algorithm. As shown on the image above, the current server hour is 11 and the trading schedule is from hour 1 to hour 12, meaning the current hour is within the trading time range. As a result, the Auto Trading button is activated (i.e., in green).
Since this program is very simple, there are only two parameters provided to the user in Inputs. The user can modify any of these parameters at any time and the desired change will take effect immediately. These options are explained below:
- Start_Time = 1 – This is the time hour on the broker side that is considered as the start of trading for any expert advisor.
- Finish_Time = 8 – This is the time hour on the broker side that is considered as the end of trading in case the user utilizes an expert advisor in trading.
When the robot turns on the Auto Trading button, it is possible that expert advisors running on the client terminal, including this program, will not carry out its functions. This is because the Allow Live Trading box in the Common tab of the expert advisor might have been unchecked when auto trading was turned off previously. The user must check if this is the case by eyeballing the smile icon beside the expert advisor. If it is smiling, live trading is allowed, while if it is frowning, live trading is not allowed.
Apart from using this program when the user wants to trade a specific time period, this expert advisor can be used in other ways. One example is in trade management, especially when another trading system subjects the trading account in heavy drawdown. This program can help that trading system at issue by turning off auto trading in case the current drawdown reaches a predetermined value or a certain percentage of the account balance.
By turning off auto trading, the other expert advisor will stop opening trades. However, this option is only possible if the other expert advisor has no function to control the drawdown by the number of maximum open trades, maximum lot size or any other parameter. It is always best to have the function to control drawdown within the expert advisor itself rather than relying on another program to switch the auto trading function on and off.
The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Exit Criteria
The Automatically Enable or Disable the Automated Trading Button Expert Advisor is not using any exit criteria as it does not take any trades from the get-go. Its sole function is to activate or deactivate the auto trading feature based on the desire of the user. This function is triggered in real time as the user wants.
The Automatically Enable Or Disable The Automated Trading Button Expert Advisor For MT4 – Suggestion for Improvement
The function of the Automatically Enable or Disable the Automated Trading Button Expert Advisor can also be performed by a script or a custom indicator. Since the script works in one go and removes itself from the terminal thereafter, it is not suitable for this purpose. On the other hand, an indicator stays on the chart as long as the user keeps it from there. Converting this expert advisor into a custom indicator might be a good area to explore.
The only downside to converting this expert advisor into a custom indicator is the possibility of running multiple instances of the indicator in several open charts. This is because multiple indicators can be run simultaneously in one chart, and it is not possible to see which indicators are running without actually going to the Indicators List window. This can be done by right-clicking on the chart and choosing Indicators List on the context menu that appears. Alternatively, the user can use a keyboard shortcut to do the same thing using the combination CTRL+I. Looking into the list of indicators is already time-consuming. This is not necessary for an expert advisor as the user can see it on the upper-right portion of the main window.
As already discussed, it is possible to use this program in tandem with another expert advisor to help control drawdown. To put this into effect, the code of the current expert advisor must be updated. This type of change is just minor, though, and will not involve a total makeover. Adding a few lines of code is all it takes to implement this. However, it should not be forgotten to add at least one variable in Inputs that the user can use to set his desired drawdown amount or percentage.