Alpha Grid MT5:   Time Tracking

Alpha Grid MT5: Time Tracking

10 March 2024, 07:10
Aliaksandr Charkes
0
124

<<   Back to the General Section with a description of the settings

Description of settings related to Time Tracking

This section describes the EA ability to start and/or end trading at a specified time. 

To get quicker information on the desired setting, you can use the page search function. This is normally accessed by pressing F3 or Ctrl+F 

Two time range control modes are supported:

CALENDAR Mode  (trading is limited to specified dates)

This mode can allow trading either within a specified calendar range (based on time), or outside a specified calendar range (if you want to block trading between specified dates). Hours and minutes for start and finish are also taken into account.

This type of trading can be used simultaneously with any other types of trading that the advisor supports.

DAILY Trading  (automatic restart of trading at specified times every 24 hours)

This mode is only available within a specified calendar period, but can be enabled or disabled at the trader’s request. If the start and finish times for daily trading are equal, this mode is considered disabled. In this case, the starting time can be greater than the finishing time, which allows you to select any 24-hour ranges without regard to the beginning of the day, and the finishing time can be less than the total time for completing the cycle.

To control daily trading, there is a separate information block inside the time panel, which helps you easily navigate the current mode settings. Also, one of the advantages of this mode is the ability to select settings for a given time range directly in the tester.

Some nuances associated with DAILY trading settings:

The time settings for daily trading can be changed at any time. If the grid has already been deployed before the start of trading, the current initial grid prices will remain unchanged and the advisor will simply continue trading after reaching the specified starting time.

The time range settings for daily trading can be changed at any time. This is a safe operation and during its execution no pending orders or market positions will be deleted or closed under any circumstances. At the same time, the automatic reset of the initial grid prices can only occur at the start of each new session, and only if there are no grid orders and positions on the chart or all scheduled (in the EA settings) closing and deleting operations are completed.

If the grid has already been deployed before the start of daily trading, the current initial prices will also remain unchanged and the advisor will simply continue trading after reaching the specified start time. The same applies to restarting the terminal. That is, if the grid remained activated before closing the terminal, then when the terminal is opened, the initial prices will also remain untouched (if the finishing time remains in the future) and no deletions or closures of orders and positions will follow. But, if the finishing time has already passed, then when the terminal is opened, the grid orders will be closed. 

If you need to reset the initial grid prices so that they are regenerated automatically, you can use the following method: you need to set the value "-1" in each setting responsible for the number of grid levels. Then the initial prices will be reset and the work of the adviser will stop. Then you need to set the required number of grid levels again and each grid will receive a new initial price.

---

When setting up this mode, it is also important to note that automatically restarting daily trading does not reset any values ​​of any other tracking modes that may be running at the same time with it. There can really be a lot of different combinations here, and not all of them are easy to predict. However, the advantage of the implemented approach is not only that all this can be run once in a fully automatic mode, but also that any changes can be made to the settings at any time. That is, any chosen strategy can be adjusted after the start of trading, and the risks of sudden collapse of the entire grid will be minimized (in any case, this is exactly the concept I tried to adhere to).



General information for ALL time modes:

If you use several charts simultaneously for one trading instrument, you can set up scheduled trading in a variety of combinations. To do this, on each such chart, for each instance of the advisor, you must use different magic numbers (in addition to other different settings).

After reaching any final time, the advisor stops automatically updating its price levels. Daily trading has its own final time, and calendar trading also has its own (outside the "Only_In_Range" or inside the specified range in the "Only_Out_Range" mode)

Also, after reaching the final time, mass closing of market positions and/or deletion of pending orders in various combinations can be carried out. At the same time, CALENDAR and DAILY trading have their own settings for this. In case of daily trading, the advisor will perform the assigned task 1 time (until it is fully completed). In the case of calendar trading, until the trader turns off this mode or unloads the advisor from the chart (in the "Only_In_Range" mode).

Information opportunities:  All the necessary data related to time tracking trading is displayed in a separate information panel created specifically to control all the specified time frames. Also, after the completion of the calendar (main) trading, a separate message is displayed about this, which will be impossible not to notice and ignore.

On-the-fly settings changes:  Almost all settings for time-tracking trading can be adjusted even after it starts. That is, you can, without problems, change the values already set and do it an unlimited number of times. At the same time, the adviser will constantly monitor the correctness of the entered settings, thereby helping to better adjust to the current trading situation.

Variety of strategies: Trading (and information) capabilities related to time tracking can be used not only for the work of the current adviser, but also for manual trading. And with some additional settings, tracking can also be used to limit the work of any other Expert Advisors.



This mode can be improved in each new version of the advisor.
And you can always check how the current version works yourself in the strategy tester.




Example of DAILY trading (Alpha Grid MT5 1.2)


Example of CALENDAR trading only (Alpha Grid MT5 1.0)


Description of Settings 

>>    Activation Mode of limiting trading by TIME
Activating the time tracking trading mode. This setting enables or disables all other settings for this type of trading. That is, if <false> is set, the values ​​of the remaining settings in this section do not matter (except for the ability to display a special panel for this mode).

Using this setting, you can also restart ALL time-tracked trading at any time necessary. For example, if the final time for calendar trading has been reached, and the trader wants to restart everything again without rebooting the advisor, you need to set this setting to < false >, approve this and then set it to < true > again.

>>    Always show Panel for limiting trading by Time
A separate information panel is created for all time-tracking trading, which allows you to fully control all the specified conditions.

Using this panel, various useful information is displayed on the chart, which allows you to better control all trading events related to time tracking. The panel has its own separate zoom setting and has its own color indicator for various events, which simultaneously serves as a button for minimizing and expanding the panel. The panel can be easily moved around the chart by simply dragging it with the mouse, and after collapsing the panel, the remaining indicator button can be placed in any convenient place, for example, on the top panel. At the same time, using the Shift + Left Mouse Click combination, you can bring the panel (or its button) to the foreground at any time.

With the general activation of trading with time tracking, this information panel will be enabled in any case (even if <false> is set in this setting). This is done in order to provide the maximum possible control (over this type of trade) by default. At the same time, in order to use the information capabilities of this panel even before starting this mode (for example, for a preliminary visual selection of settings or for manual trading), you can set the value < true> here, and then the panel will be displayed even if this trading mode is disabled.
>>    Start DATE of Trading
Here you can set any CALENDAR time (server's) from which the adviser should start its work (or pause in the "Only Out Range" mode). If the time is set in the past, then it will automatically be equated to the present moment. The current time of the trading server can be viewed in any information panel.
>>    DAILY trading Start Time  [ server's ! ]
Here you can set any time (server's) from which the advisor should start working in DAILY trading mode. Time is specified in hours, minutes and seconds. In this case, only whole numbers will be taken into account (fractional parts, minuses and any other characters are cut off). Forms for recording this time may vary, but it is recommended to use the following template:  00:00:00

In the information panel (in the daily trading block) you can see what time the advisor ultimately accepted. It is also recommended to pay attention to the tooltip for this value, where you can always see the calendar time of the start of the CURRENT daily trading session.
>>    DAILY trading Finish Time  [ server's ! ]
Here you can set any time (server) from which the adviser should start its work (or pause in the "Only Out Range" mode). If the time is set in the past, the EA starts trading immediately. The current time of the trading server can be viewed in any information panel.
>>    Finish Time  [ server's ! ]
Here you set the final time (server's) for DAILY trading after which the advisor stops trading until the start of a new session. After reaching this time, the advisor stops auto-updating its price levels + mass closing of market positions or deletion of pending orders in various combinations can be carried out (this is set in a separate setting for the DAILY mode).

Time is specified in hours, minutes and seconds. In this case, only whole numbers will be taken into account (fractional parts, minuses and any other characters are cut off). Forms for recording this time may vary, but it is recommended to use the following template:  00:00:00

In the information panel (in the daily trading block) you can see what time the advisor ultimately accepted. It is also recommended to pay attention to the tooltip for this value, where you can always see the calendar time of the end of the CURRENT daily trading session.
>>    Trading Range TYPE for CALENDAR dates

<  Only In Range  >   

Placing and restoring orders only INSIDE the specified CALENDAR range  

<  Only Out Range  > 

Placing and restoring orders only OUTSIDE the specified CALENDAR range

>>    Control Panel scale 
Scaling the information panel for a given trading mode (increase or decrease)

>>    Selecting a deletion mode after reaching the DAILY Limit
Using this setting, you can select which market positions or pending orders will be closed or deleted after the end of the current DAILY trading session. In this mode, this happens once until the task is fully completed.

A detailed description of all the points that this setting controls completely coincides with the description of exactly the same setting for calendar trading...
>>   Selecting a deletion mode after reaching the DATE Limit
Using this setting, you can select which market positions or pending orders will be closed and deleted after the end of CALENDAR trading in the "Only In Range" mode (or during a pause in the "Only Out Range" mode). In this case (in the "Only In Range" mode), the advisor will continue to do this until the trader turns off this mode or unloads the advisor from the chart.


<  Do not Delete or Close anything  >
No actions with orders and positions are required. In this case, the EA will simply stop auto-updating its price levels.


ALL EA Orders AND Positions  >
Deleting all pending orders and market positions of the Expert Advisor for the current currency instrument

EA Market Positions Total  >
Closing only market positions of the  Expert Advisor for the current currency instrument

EA Pending Orders Total  >  

Deleting only pending orders of the Expert Advisor for the current currency instrument

<  EA BUY Market Positions Only  >

Closing only market positions of the BUY type EA for the current instrument

<  EA SELL Market Positions Only  >
Closing only market positions of the SELL type EA for the current instrument


ALL SYMBOL Orders AND Positions  >
Deleting all pending orders and market positions for the current currency INSTRUMENT

SYMBOL Market Positions Total  >
Closing all market positions for the current currency INSTRUMENT

<  SYMBOL Pending Orders Total  > 

Deleting all pending orders for the current currency INSTRUMENT

<  SYMBOL BUY Market Positions Only  >

Closing only market positions of the BUY type for the current INSTRUMENT

 SYMBOL SELL Market Positions Only  >
Closing only market positions of the SELL type for the current INSTRUMENT


<  ALL ACCOUNT Orders AND Positions  >

Deleting all pending orders and market positions for the entire ACCOUNT

<  ACCOUNT Market Positions Total  >
Closing all market positions on the current account for the entire ACCOUNT

<  ACCOUNT Pending Orders Total  >

Deleting all pending orders for the entire ACCOUNT

<  ACCOUNT BUY Market Positions Only  >

Closing only market positions of the BUY type for the entire ACCOUNT

 ACCOUNT SELL Market Positions Only  >
Closing only market positions of the SELL type for the entire ACCOUNT