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

 
Roman Sharanov:
Is there any way to make two OnTimer functions with different periods?

Which ones are "different"?

 
Roman Sharanov:
Is there any way to make 2 OnTimer functions with different periods?

You can make one timer and check several periods in it

 
Vitaly Muzichenko:

What kind of "different"?

in 1 minute and 5 minutes for example

 
Roman Sharanov:

in 1 minute and 5 minutes for example

Create a timer with a shorter period and make it check the longer period

datetime Delay;

void OnTimer() {

// Delay
  if(Delay<TimeLocal()) {
   PlaySound("alert.wav");
   Delay=TimeLocal()+300; // 300 сек = 5 минут
  }
//-
}
 
Igor Makanu:

data is obtained from indicator buffers

it is possible to receive all data from scripts, Expert Advisors and indicators, it is necessary to know a name of a graphic item or search through all graphic items

universal method - data exchange via global variables of the terminal or a file

you cannot simply change input variables from another MQL-program


you can use a string and then enter numbers separated by commas, but I don't know what the maximal length of the string is - you need to check

It's probably a case of severe and prolonged illness and critical illiteracy.

Did you understand what you wrote for me to understand?

You probably didn't go to school at all and you don't know Russian at all.

I am quoting you from the description of the language:

https://www.mql5.com/ru/docs/basis/variables/global

Initialization of global variables is performed only once after program loading into the client terminal's memory and before the first processing ofInit event.

Do you understand what the Russian word "once" means - or is it too difficult for you?

Before replying to "newbies" on the forum, study Russian and the MQL programming language. And do not "piggyback a truckload of tools".

I've provided a link to a good article by Alexei Subbotin on this subject for the forum users:

TRANSFER OF DATA BETWEEN INDICATORS - A SIMPLE SOLUTION TO A PAINFUL PROBLEM

January 15, 2010, 10:35

https://www.mql5.com/ru/articles/19

As far as I understand from the description of MQL, data transfer between indicators and scripts is NOT PROPOSED.

This is why you have to invent your own ways of transferring data from one program section to another.

Документация по MQL5: Основы языка / Переменные / Глобальные переменные
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
  • www.mql5.com
Глобальные переменные создаются путем размещения их объявлений вне описания какой-либо функции. Глобальные переменные определяются на том же уровне, что и функции, т. е. не локальны ни в каком блоке. Область видимости глобальных переменных - вся программа, глобальные переменные доступны из всех функций, определенных в программе...
 
neverness:

It is probably a case of severe and prolonged illness and critical illiteracy on the part of the respondent.

Did you understand what you wrote me to make me understand?

You probably didn't go to school at all and you don't know Russian at all.

I am quoting you from the description of the language:

https://www.mql5.com/ru/docs/basis/variables/global

Initialization of global variables is performed only once after the program is loaded into the client terminal's memory and before the first processing ofInit event.

Do you understand what "once" means, or you are not so sure about it too.

Before replying to "newbies" on the forum, study Russian and the MQL programming language. And do not "piggyback a truckload of cows.


Well, you have a search problem and insolence bordering on inadequacy

https://www.mql5.com/ru/docs/globals

You're hopeless, but I'll try to educate the ill-mannered type, here's more to understandhttps://www.mql5.com/ru/docs/basis/variables/global

Документация по MQL5: Глобальные переменные терминала
Документация по MQL5: Глобальные переменные терминала
  • www.mql5.com
Глобальные переменные существуют в клиентском терминале 4 недели с момента последнего обращения, после этого автоматически уничтожаются. Обращением к глобальной переменной считается не только установка нового значения, но и чтение значения глобальной переменной.
 
neverness:

It is probably a case of severe and prolonged illness and critical illiteracy on the part of the respondent.

...

Now try without the insults and arrogance.
I will not tolerate rudeness on this forum.
 
Igor Makanu:

Well, you have a search problem and chronic arrogance bordering on inadequacy

https://www.mql5.com/ru/docs/globals

You are hopeless, but I'll try to educate the rude type, here's more to understandhttps://www.mql5.com/ru/docs/basis/variables/global

Show me, WHERE IS THE TRANSFER OF DATA FROM ONE INDICATOR TO OTHER?

Global Variables is a generic immutable data field that has the property of visibility from all areas and running programs.

And this field is initialized only once at program startup.

Where is the data transfer?

Let's simulate a simple situation.

Let's take two different indicators and describe in them the same global variables, but with different values.

Now let's start the first indicator with initialization of global values.

After that, we will run the second indicator, also with initialization, but with different values.

As a result we will get a fatal error.

What have we "passed" in such a way? - A message about fatal error?

 
neverness:

Show me, WHERE IS THE TRANSMISSION OF DATA FROM ONE INDICATOR TO OTHER?

Global Variables is a generic immutable data field that has the property of being visible from all areas and running programs.

And this field is initialized only once at program startup.

Where's the data transfer?

https://www.mql5.com/ru/docs/globals

A group of functions designed to work with global variables.

Global variables of the client terminal should not be mixed up with variables, declaredat global level of the mql5-program.

Global variables exist in the client terminal for 4 weeks after the last access, then they will be automatically deleted. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well.

Global variables of the client terminal are accessible simultaneously from all mql5 programs launched in the client terminal.


I'm not going to teach you how to read technical information, you asked me how to transfer data between MQL-programs, I wrote it, now you can either read it or beat your head in, or whatever other methods of obtaining information exist in such vile types as you
Документация по MQL5: Глобальные переменные терминала
Документация по MQL5: Глобальные переменные терминала
  • www.mql5.com
Глобальные переменные существуют в клиентском терминале 4 недели с момента последнего обращения, после этого автоматически уничтожаются. Обращением к глобальной переменной считается не только установка нового значения, но и чтение значения глобальной переменной.
 
Igor Makanu:

https://www.mql5.com/ru/docs/globals

I am not going to teach you to read technical information, you asked me how to transfer data between MQL-programs, I wrote it, now you can either read it or beat your head in, or whatever other ways such ugly guys like you use to get information.

I told you straight out that you shouldn't teach others when you have no idea yourself.

Help should be 'qualified' and not 'from a torch' !

Reason: