Errors, bugs, questions - page 153

 
abeiks:

How do you make a variable declared inside one block, visible in other blocks?

Not
 
abeiks:

Hello!

How do you make a variable declared inside one block, visible in other blocks?

This is probably not possible. Although you should probably rephrase the question.

Variables (and not only variables) declared at module level are visible in the whole module and in other modules as well (if this module is declared there).

Variables declared inside a code block (procedure or function) are available only within this block.

Public variables declared within a class are available to descendants or variables of that class type.

There is also a specific type of variables as Global Variables (there is a set of specialized functions for them since MQL4).

 
Interesting:

This is probably not possible. Although the question probably needs to be reworded.

Variables (and not only variables) declared at module level are visible in the whole module and in other modules as well (if this module is declared there).

Variables declared inside a code block (procedure or function) are available only within this block.

Public variables declared within a class can be accessed by descendants or variables of that class type.

There is also a specific type of variables as Global Variables (there is a set of specialized functions for them since MQL4).

" According to the idea, variables (and not only variables) declared at module level are visible in the whole module, as well as in other modules (if this module is declared there)."

How can a module be declared where this can be read?

And izcho question, what is the difference between modules, buffers, classes... ? Where can I read it?

 
abeiks:

"The idea is that variables (and not just variables) declared at module level are visible throughout the module, as well as in other modules (if the module is declared there)."

How can a module be declared where this can be read?

And izcho question, what is the difference between modules, buffers, classes... ? Where can I get this information?

In general the bulk of the answers can be found in the help, in particular on the scope of variables here(https://www.mql5.com/ru/docs/basis/variables/variable_scope).

If you were to ask a specific question with an example and a description, you would have a better chance of getting a more complete answer.

Документация по MQL5: Основы языка / Переменные / Область видимости и время жизни переменных
Документация по MQL5: Основы языка / Переменные / Область видимости и время жизни переменных
  • www.mql5.com
Основы языка / Переменные / Область видимости и время жизни переменных - Документация по MQL5
 
alexvd:

In general, a lot of answers can be found in the help, in particular on the scope of variables here(https://www.mql5.com/ru/docs/basis/variables/variable_scope).

If you were to ask a specific question with an example and a description, you would have a better chance of getting a more complete answer.

I posed a concrete question in another thread on the example of the EA under discussion: https://www.mql5.com/ru/forum/1268/page6.

Please, if it's not difficult, take a look there.

Обсуждение статьи "Создание эксперта, торгующего на разных инструментах"
Обсуждение статьи "Создание эксперта, торгующего на разных инструментах"
  • www.mql5.com
В данной статье автором предложен вариант максимально простого подхода для построения мультивалютного эксперта для первоначального знакомства с этим направлением торговых стратегий.
 
abeiks:

"The idea is that variables (and not just variables) declared at module level are visible throughout the module, as well as in other modules (if the module is declared there).

How can I declare a module, where can I read it?


I was referring to the inluded connection of the module. This way you can split large projects into modules (units). For example, you can divide a 5000-line project into several units.

This approach will allow you to create hundreds of Expert Advisors on one code.

The modules are plugged simply like modules of the standard library.

#include <\Charts\Chart.mqh> //Class - Chart

abeiks:

And what's the difference between modules, buffers, classes... ? Where can I read it?

For modules, classes and all the other charms of OOP you can read in MQL5 help, books on OOP in other languages, or Google...
 
abeiks:

And Izcho question, what is the difference between modules, buffers, classes... ? Where can I find out about it?

"The two came out of the forest. She told him a 3-letter word, making four mistakes in it, then they turned back. What word did she say to him ? " :)
 
abeiks:

And Izcho question, what is the difference between modules, buffers, classes... ? Where can I find out more about it?

Your expert is already at the start. Are you kidding ?
 
Valmars:
Your expert is already at the start. Are you kidding?
I still don't understand classes, but that doesn't stop me from participating)
 

Hello, could you please advise whether it is possible to add to MT5 a Period Converter indicator for displaying any non-standard timeframes? I have not been able to convert it, it generates a lot of errors.

Files: