Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1158

 
Andrey Sokolov:

Hello. Who has such a question? I don't.

Well, tell me why you want it that way. Also tell me why you need it - it's a C-like language, and it has a syntax that you want to change. Why and what for is not clear. But if you're asking questions, it means you need to. And why?

 

Good afternoon! Please help me solve a problem. I need to look inside the bars on TF H4 and make some calculations inside this bar of, say, all the bars of M15 TF. Maybe we should use bars of the major frame (not all of them, but all of them that we need) in the array (see the picture). I.e. we know the time of bar formation on H4 and the lifetime of the bar is 4 hours, and we know the number of M15 bars inside H4 and the time of their formation and lifetime. Please, expert, advise me.


 
Evgeniy Butakov:

Good afternoon! Please help me solve a problem. I need to look inside the bars on TF H4 and make some calculations inside this bar of, say, all the bars of M15 TF. Maybe we should use bars of the major frame (not all of them, but all of them that we need) in the array (see the picture). I.e. we know the time of bar formation on H4 and the lifetime of the bar is 4 hours, and we know the number of M15 bars inside H4 and the time of their formation and lifetime. Could you, please, help us, experts?


If you have set out the problem like this, it is difficult to suggest something. What do you need as a result? But try to read in documentation about Copy*** function there is possibility to get all data of M15 in date/time range from and to.

 
Alexey Viktorov:

It's hard to know what to do with a problem like this. What do you need as a result? But try to read in documentation about Copy*** function there is possibility to get all data of M15 in date/time range from and to.

As a result, looking at the picture, I want to get the average price of M15 bars inside bar 1 and 2 from H4. How to calculate the average is not the problem. I stalled at the moment of getting the M15 bars info from H4 candle.

 
Evgeniy Butakov:

As a result, looking at the picture, I want to get the average price of M15 bars inside bar 1 and 2 from H4. How to calculate the average is not a problem. Stalled at the point of getting the M15 bar info from the H4 candle.

So you should definitely go to the documentation...

CopyRates - Доступ к таймсериям и индикаторам - Справочник MQL4
CopyRates - Доступ к таймсериям и индикаторам - Справочник MQL4
  • docs.mql4.com
Получает в массив rates_array исторические данные структуры MqlRates указанного символа-периода в указанном количестве. Отсчет элементов от стартовой позиции ведется от настоящего к прошлому, то есть стартовая позиция, равная 0, означает текущий бар. При копировании заранее неизвестного количества данных рекомендуется в качестве приемного...
 
Alexey Viktorov:

Then you should definitely go to the documentation...

Thank you...
 
Artyom Trishkin:

So tell me why you want to do that. Tell me why you need to do it - it's a C-like language, and it has a syntax you want to change. It's not clear why or what for. But if you're asking questions, it means you need to. And why?

Because I like it better, it's more convenient for me. I hope it will not come to an argument about tastes.

About "c-similarity" - there are opinions that if you remove the brackets, the language does not cease to be c-similar.

 
Andrey Sokolov:

Because I like it better, I'm more comfortable that way. I hope it doesn't come to an argument about taste.

About "c-like" - there are opinions that if you remove the brackets, the language does not stop being c-like.

If you like it, write it without brackets.
 
Artyom Trishkin:
If you like it, write it without the brackets.

Is this humour/trolling?

An editor wouldn't understand such an entry. The question is how to make an editor understand such an entry.

 
Andrey Sokolov:

Is this humour/trolling?

An editor wouldn't understand such an entry. The question is how to make an editor understand such an entry.

He will understand.
If it's .
then
But we will have to write one action per condition.
If one condition must have many actions, then write the same condition as many times as you need for each action.
But without the brackets...
Reason: