Expert Advisor that opens orders every hour, on time and at the right moment. How to limit the trading time of Forex advisors? Advisor Time Limit

02.08.2021

Achieving success in the forex market today is almost impossible to take into account the stable patterns of price behavior, which can be expressed in any of its actions.

One of such striking patterns, which is familiar to almost every trader, is manifested in the activity of the price at a certain time of the day.

Actually, this is why most advisers and trading strategies, today are endowed with a trading filter by time, when a trader prohibits trading on a strategy in an unfavorable time period.

Trade high only with a leading broker

However, the time factor can often be a signal pattern, and the trader needs to implement it somehow.

It is natural to constantly be at the monitor at a certain time with an accuracy of seconds in order to open the planned position is not always possible.

That is why traders use special scripts and advisors that allow you to open a position at a specified time for them. Actually, we will get acquainted with one of these advisers in this article.

The OpenTime 2 Time Advisor is a completely independent trading expert for the MT5 trading terminal, which allows you to implement strategies based on the patterns of price movement at a certain time of the day.

A notable feature of OpenTime 2 is the fact that the functionality of the robot allows you to make it a completely independent expert and find patterns of price movement on a particular asset using optimization.

Thus, a trader can create strategies based on time patterns, as well as use it as an assistant to implement their ideas, for example, to open deals during news releases (trading on expectations).

Installing the script on the chart.

The first version of the Time Advisor for the MT5 trading terminal was developed back in 2017, however, the functionality of the robot was so limited that it could be safely attributed to simple scripts rather than full-fledged robots.

However, after expanding the functionality in 2018, following the recommendations of many traders, the robot not only gained popularity, but two versions of it were published in the official library of MT5 developers.

Thus, the adviser can be installed in two ways, namely through the library in your MT5, or through the data directory according to the standard scheme.

To install an adviser through the library, launch your MT5 trading terminal and move to the "Tools" panel, where you can find information on your positions and balance.

Then move to the "Library" tab and perform a simple sorting so that only advisers appear in the list.

After you sort the list, find the OpenTime 2 time adviser in it and load it using the additional menu as shown in the image below:

If installation in this way caused difficulties, go to the end of the article and download the robot file, which you will install according to the standard scheme.

To do this, you just need to drop the downloaded robot file into the MT5 terminal directory, namely into the Experts folder.

Regardless of the installation method that you have chosen, after installing the expert, you must restart trading terminal or update it in the Navigator panel, otherwise OpenTime 2 will not appear in the list of Expert Advisors.

Applying the OpenTime 2 Time Advisor

As we noted at the very beginning of the article, the OpenTime 2 time adviser is an assistant that allows you to implement strategies based on the patterns of price movement at a certain time of the day.

The second version of the robot has become more autonomous and flexible, which allows you to more carefully configure the system for opening and tracking deals.

So in the lines Use closing time interval and Closing time interval #2 you can give permission for early closing of deals for the first and second time intervals, while the time for each of the closing intervals can be set in the lines Closing time interval 1,2.

The Trailing stop variable allows you to activate trailing stop , while the stop movement step is specified in the Trailing step line.

In the Trade on Monday - Friday variables, you can disable trading on a specific day of the week, and in the Opening start time interval and Opening end time interval lines, you can set the time period during which a position should be opened.

The Duration in seconds variable is responsible for the time an open position is held, and in the Type of trade in time interval line, you can specify the direction of the trade, namely to buy or sell.

The Volume transaction variable is responsible for the trading lot of the opened order, and in the StopLoss time interval and TakeProfit time interval variables, you can specify the profit and stop order for your position.

In conclusion, it is worth noting that the OpenTime 2 time adviser is a more advanced and autonomous assistant that allows you to implement strategies based on opening positions at a certain time of the day.

Today we will talk about the Trade Scheduler robot, which has a very interesting feature. When using automatic systems in Forex trading, have you noticed that on certain days of the week or hours they often bring losses? For example, on the first day of the week, the adviser opens very few trades, and most of them are also unprofitable. In such cases, it makes sense to turn off the adviser before Saturday and turn it on on Tuesday. You can carry out this simple operation manually, but it is also easy to forget to turn off or turn on the adviser at the right time.

The solution to this problem (and a couple of others) can be robot use Trade Scheduler, which does not trade itself, but allows you to limit the time of work of other Expert Advisors according to the schedule, based on the analysis of the work of these Expert Advisors.

Before making adjustments to the temporary mode of operation, it is necessary to find out at what moments it often trades in the red. In this case, the MyFXbook service will be of help, where detailed statistics of the system's trading by days of the week and hours are presented. The optimal trading period for analyzing the operation of the system is 3 months. To conduct it, you need to start monitoring on the service. You can read about installing a robot on MyFXbook. As an example, let's consider the results of the work of the Expert Advisor, the monitoring of which can be found by clicking on the picture:

Rice. 1. Monitoring the operation of the Transient Zones 2.0 Expert Advisor on the MyFXbook service.

As an option for those who do not yet have enough trading history of the robot to analyze it on a real account, but at the same time it can be tested, feel free to upload the report obtained from .

After loading and processing the monitoring, you need to go to the extended statistics section, the Daily tab. Here you can find information on the relative amount by day of the week. In our example, the largest number of losing trades falls on Thursday and Friday, which means that it would be reasonable to suspend the Expert Advisor on these days. The reason for this behavior may lie in the state of the market, which these days is not suitable for the strategy of the robot, and its calculations are less accurate:


Rice. 2. The ratio of profitable and unprofitable transactions of the Transient Zones 2.0 Expert Advisor for the week.

After analyzing by day, you can analyze the effective work by hours. To do this, go to the Hourly tab and see when the relative number of losing trades is greater:


Rice. 3. The relative number of losing and profitable trades by hours.

Conclusion: it would be reasonable to stop the trading process on Thursday, Friday, and for other days to block its work in the first two hours of a new day, and during the day during those hours when losing trades prevail - in particular, at 12, 13, 14 hours of the day . That is, leave him to work at night from 2 to 8 in the morning inclusive, and from 13 to 21 in the afternoon. The result of the adviser's work should improve significantly.

Installing and configuring the expert.

The installation of the Trade Scheduler auxiliary adviser is carried out by analogy with any other adviser, more about this is written in . You can download the archive with the expert from the link below:

Download trade-scheduler.rar (downloads: 147)

Unzip the trade-scheduler.rar archive, copy the TradeScheduler v2.3.ex4 expert file to the data_folder\MQL4\Experts\ folder. To open the data catalog, select the Open data catalog item from the File menu. Then the terminal restarts and after that the adviser can be found in the Navigator - Expert Advisors window.

When installing an Expert Advisor on a chart, the required time of work is set in the settings window by days of the week and hours. The time is set depending on the time of the terminal, it is also the time. For each day there are 3 input parameters. The first parameter is responsible for enabling/disabling the robot on a specific day of the week, the second parameter is for the trading start time, and the third is the stop time. The time is specified in the format hours: minutes:


Rice. 4. Input parameters set after the analysis of the Expert Advisor.

Also in the settings there is an additional parameter CloseBeforeSwitchOFF . If set to CloseAll, all trades will be closed automatically before the robot is turned off. If CloseAllProfitable - only profitable orders will be closed, if No - trades will not be closed. The parameter Slip is responsible for the maximum allowable slippage.

Make sure that autotrading and import of functions from DLL are allowed in the terminal. One version of the advisor is installed for one terminal.

Conclusion.

Want to improve performance your adviser? Try the method of limiting its work and analyze the results. If the statistics show that your Expert Advisor "constantly merges" at a certain time of the day, it means that there is a pattern on the market that it cannot handle. Stop trading during this unfavorable period and increase its profitability!

You have probably noticed that transactions on certain days or even hours bring a loss. For example, it can be transactions on Friday evening, the result of which, when transferred through the weekend, is often unpredictable. How to be? Manually enable and disable the adviser? This is not very convenient, and we are all human - you can just forget to do it.

Problem Solving - Assistant Advisor Trade Scheduler, which allows you to limit the time of work of other Expert Advisors according to the schedule set by the trader. For example, you can restrict robot trading from 7 a.m. to 11 a.m. Monday. This development is from our friends from ArgoLab and today we will get acquainted with it in detail.

Statistics analysis

Before limiting the work of the adviser, you must first determine at what time the strategy gives up. To do this, you can use one of the monitoring services, such as myfxbook, which gives detailed trading statistics over time. In order for the analysis to be reliable, it is desirable to have trading statistics for at least three months.

So, for starters, you need to start monitoring on myfxbook. For information on how to do this, see our website. . For example, let's take the monitoring of an adviser Forex Hunter.

You can also upload a report from the strategy tester to the site. First of all, this is necessary for those who do not yet have enough accumulated history on a real account, but there is a robot that can be tested in the tester. How to do this, again, read inseparate article .

Further, after the monitoring has been loaded and processed, go to the extended statistics section, to the “Daily” tab. It displays the number of profitable and losing trades by day of the week. As you can see, on Thursday and Friday the largest relative number of losing trades is 73% and 74%, respectively. This means that the market conditions these days are not suitable for this strategy, the forecasts are less accurate and the EA is losing money. To improve the efficiency of the automatic strategy, it is reasonable to remove these days from trading.

Then we look at the statistics by the hour. The arrows in the screenshot mark the hours with the largest number of losing trades. In addition to the fact that during the night period (mainly the Asian session) there are not only much fewer transactions than in the middle of the day, but the quality of entries also leaves much to be desired.

This means that if we block the work of the Expert Advisor on Thursday and Friday, leaving it to work on other days from 11 am to 7 pm, the result is guaranteed to improve.

The EA settings for changes in this example will look like this:


Installation and setup

The advisor is installed in a standard way. Open the terminal data directory via File - Open data directory, and go to the MQL4 - Experts directory. Here we copy the previously downloaded Expert Advisor file with the “.ex4” extension. To make the Expert Advisor appear in the Navigator window, restart the terminal.

In the settings, you need to specify the operating time according to the days of the week. There are three input parameters for each day. The first one is responsible for enabling/disabling trading on a certain day, the second - for the start time of trading, the third one - for the end of trading. Time can be specified to the nearest minute. The start time can be greater than the end time, such as 19:00 and 9:00. In this case, trading will be allowed from 00:00 to 9:00 and from 19:00 to 24:00.

The additional CloseBeforeSwitchOFF parameter is responsible for closing all positions immediately before turning off autotrading. In total, the parameter can take three values: No - positions are not closed; CloseAllProfitable - only profitable ones are closed; CloseAll - exit from all open positions. The slip parameter is responsible for the maximum slippage.


Don't forget to enable autotrading and import functions from DLL libraries.

The time must be specified, focusing on the terminal time, which is displayed in the title of the Market Watch window. It's your broker's time.

Also, do not try to install multiple instances of the advisor on one account - just one instance is enough. Otherwise, none of them will work correctly.

Conclusion

Time limiting is the easiest and most effective way to improve your trading performance. For example, if the adviser consistently merges from 4 to 8, then there is a different pattern on the market, which the robot cannot handle. Just not trading during this period - you increase the overall profitability and unload the deposit from unnecessary transactions.

Forum thread

Sincerely, Alexey Vergunov
TradeLikeaPro.ru

Source http://tradelikeapro.ru/sovetnik-tradescheduler/

This Expert Advisor is ideal for those who trade by levels and any strategies using pending limit orders. The EA will place orders at the right time at the right distance from current price! In the robot settings, you can set stop losses, take profits of orders, as well as the lot of each order. Everything is set for each order separately. You can only place buy limit, or sell limit, or both orders together!

The EA is ready to work on any trading instrument, in any Metatrader 4 trading terminal. The robot is also ready to work on several currency pairs straightaway. That is, you can open any number of pairs and install an adviser on them, setting each one with its magic number and time settings. After that, each pair will work strictly individually. If you are still working with limit orders manually, this robot is for you!

  • BUY_limit- Whether to place an order to buy a limit.
  • lot_buy_limit- Lot orders buy limit.
  • R_buy_limit- Distance from the current price to the buy limit order in points.
  • Stop_Loss_buy_limit- Stop loss buy limit orders.
  • Take_Profit_buy_limit- Take profit buy limit orders.
  • SELL_limit- Whether to set a sell limit order.
  • Lot_sell_limit- Lot orders sell limit.
  • R_sell_limit- Distance from the current price to the sell limit order in points.
  • stop_loss_sell_limit- Stop loss orders sell limit.
  • Take_Profit_sell_limit- Take profit orders sell limit.
  • slippage- Maximum slippage in points.
  • Close_Orders- Closing the second order when opening the first one.
  • Times- Order lifetime in minutes.
  • Time_Start- Set orders on time?
  • Time_Hour- Hour of opening orders 0-23
  • Time_Minute- Minute of opening orders 0 - 59. For example, hour = 5, minute 40, so at 5.40 orders will be placed from the price at that moment.
  • Expert_I- magic number to determine your orders and multi-currency trading.