Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1493

 
grezky EventSetTimer(3600); // 3600 seconds = 60 minutes

it means that the next check of the terminal variable value will occur in 60 minutes.
But in the Tester with visualisation 60 minutes will run in a few seconds, and the Indicator will check the values after 60 minutes.
Or should the Expert Advisor in the Tester and the Indicator in a separate window be somehow 'synchronised' in time? - i.e. if the Expert Advisor sends a value to the terminal variable in a few seconds, then the Indicator will call for checking the value of the terminal variable also in a few seconds?
Has anyone encountered something like this, how is it solved?

The tester minute is modelled in the tester. What's stopping you from checking it? It's simple.

 
Artyom Trishkin #:

The tester minute is modelled in the tester. What's stopping you from testing? It's easy.

The indicator will be run in a separate window, how will it know that it is necessary to check the value of the terminal variable not after 3600 seconds, but after a few seconds, according to the work of the tester?
 
grezky #:
The indicator will be run in a separate window, how will it know to check the value of the terminal variable not after 3600 seconds, but after a few seconds, according to the work of the tester?

Not clear question.

 
Artyom Trishkin #:

Not a clear question.

I described it 1-2 pages ago.
In the tester in the Visualisation mode will run the Expert Advisor trading simulator (already made) on price action on M5, trading manually.
For analysis we also need the H1 chart - it will be opened in a separate window, and in order not to be able to look into the future to the right of the current M5 bar of the tester in the window with H1 the indicator will draw a black rectangle. The opening time of the last (i.e. zero in the tester) bar of M5 will be transmitted to the indicator through the terminal variable (bars will be hidden by a rectangle to the right of this time).

If I send a new value of H1 bar opening time from the tester once an hour, it will actually take 1-2-3 seconds in the tester, but the indicator will check the value of the terminal variable every 3600 seconds.
I think - I will probably make a check in the indicator not after 3600 seconds, but after 2-3 seconds.

PS Metatrader is disconnected from the Internet, ticks do not come to the indicator.

- - - -

I have written an indicator for testing, but I get an error (I used to use init, deinit, start, and I have not encountered OnCalculate(), etc.), what is the error?
.

OnCalculate function declared with wrong type or/and parameters CHECK___TESTER_TermVariable.mq4 33      5
OnCalculate function not found in custom indicator              1       1
1 errors, 1 warnings            2       2


#property indicator_chart_window

datetime   MTF_Time_0            = 0;




void OnInit() {
//   EventSetTimer(3600);   // 3600 секунд = 60 минут
   EventSetTimer(3);        // 3 секунды - периодичность запуска функции OnTimer()
   return;
}



void OnDeinit(const int reason) {
   EventKillTimer();
}




void OnTimer() {
   if(GlobalVariableGet("_AA__MTF_Time_0")>MTF_Time_0 ) {
      MTF_Time_0                 = GlobalVariableGet("_AA__MTF_Time_0");
      GlobalVariableSet("_AA__MTF_Time_0", 0);
   } // if(GlobalVariableGet("_AA___Time_Control_Check")>=Time[0] ) {
} // void OnTimer() {




int OnCalculate(int Time_tmp) {
   if(MTF_Time_0>0) {
      ObjectDelete(       "VLINE_Name_1");
      FUNCTION_DRAW_VLINE("VLINE_Name_1", clrPink, 1, MTF_Time_0, true, TimeToStr(MTF_Time_0, TIME_DATE|TIME_MINUTES), 0);
   }
   Time_tmp                      = MTF_Time_0;

   return(Time_tmp);
} // void OnCalculate() {


 
grezky #:
I described it 1-2 pages ago.
In the tester in the Visualisation mode will run the Expert Advisor trading simulator (already made) on price action on M5, trading manually.
For analysis we also need the H1 chart - it will be opened in a separate window, and in order not to be able to look into the future to the right of the current M5 bar of the tester in the window with H1 the indicator will draw a black rectangle. The opening time of the last (i.e. zero in the tester) bar of M5 will be transmitted to the indicator through the terminal variable (bars will be hidden by a rectangle to the right of this time).

If I send a new value of H1 bar opening time from the tester once an hour, it will actually take 1-2-3 seconds in the tester, but the indicator will check the value of the terminal variable every 3600 seconds.
I think - I will probably make a check in the indicator not after 3600 seconds, but after 2-3 seconds.

PS Metatrader is disconnected from the Internet, ticks do not come to the indicator.

- - - -

I have written an indicator for testing, but I get an error (I used to use init, deinit, start, and I have not encountered OnCalculate(), etc.), what is the error?
.





Again, I don't understand why all this with black squares and different graphs is so complicated, but I'll repeat: the time in the tester is emulated. An hour of tester time is not equal to an hour of real time. It is equal to an hour of emulated tester time.

Who prevents the Expert Advisor from covering (for some reason) the chart with a black curtain when opening a new hour bar is not clear....

 
Artyom Trishkin #:
Who prevents the EA from covering (for some reason) the chart with a black curtain when opening a new hourly bar is not clear....

M5 chart is open in the tester, but I need H1 (at least) to analyse the market situation.
(trades are opened on M5 in the tester, but manually, analysis on H1 is also done 'manually').
H1 will be opened in another window, not in the tester, the indicator that closes the right side will run there.
The indicator will get time from the tester, but it=indicator will check by the real time, i.e. through the real hour, not through the tester one.

Please check where the error is in the code given in the previous message.
Maybe I will be satisfied with checking after 3 seconds and then the issue will be solved.
PS Code for MT4.

 
grezky #:

M5 chart is open in the tester, but I need H1 (at least) to analyse the market situation.
(trades are opened on M5 in the tester, but manually, analysis on H1 is also done 'manually').
H1 will be opened in another window, not in the tester, there will run an indicator that closes the right part.
The indicator will get time from the tester, but it=indicator will check by the real time, i.e. through the real hour, not through the tester one.

Please check where the error is in the code given in the previous message.
Maybe I will be satisfied with checking after 3 seconds and then the issue will be solved.
PS Code for MT4.

For questions on MT4, please write to the appropriate thread. Here - questions about MQL5 and MetaTrader 5 terminal.

 
Artyom Trishkin #:

Again it is not clear what is the purpose of all this stuff with black squares and different graphs, but once again I repeat: the time in the tester is emulated. An hour of tester time is not equal to an hour of real time. It is equal to an hour of emulated tester time.

Who prevents the Expert Advisor from covering (for some reason) the chart with a black curtain when opening a new hour bar is not clear....

Time emulation is usually not clear to everyone.)))))

It is always better to be more detailed, it just means that the tester will go through all the events of an hour in a second or faster.)))))

 

Good afternoon.

Can you tell me how to arrange a re-run of the received optimisation parameters, but for a different period of time.

Optimised for the last half a year on one currency pair parameters, recorded in Excel. I took the period for the last year, and I want to run the parameters. How do I put them back into the tester or optimiser.
Check what will pass, what will not pass, write it down in Excel. Maybe then I can also run for example for the last 2 years.

 
Maksim Burov #:

Good afternoon.

Can you tell me how to arrange a re-run of the optimisation parameters obtained, but for a different period of time.

Optimised for the last half a year on one currency pair parameters, recorded in Excel. I took the period for the last year, and I want to run the parameters. How do I put them back into the tester or optimiser.
Check what will pass, what will not pass, write it down in Excel. Maybe then run for example for the last 2 years.

Select the period on which you want to run your data. And then in the tab of the obtained parameters, right-click on the required parameters and select single test.
Reason: