Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1590
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I adjust as follows:
1.I click on the slider once, then the mouse can be moved, the main thing is not to click in other spaces
2.I adjust it by pressing the arrows on the keyboard - faster slower
P.S., on the built-in MT4 strategy tester
A question has arisen. Does it make sense to declare static variables in the global scope.
In the local one I understand, no visibility outside the function body and saving values of the previous call.
And what could be the point in a global one?
A question has arisen. Does it make sense to declare static variables in the global scope.
In the local one I understand, no visibility outside the function body and saving values of the previous call.
And what would be the sense in a global one?
Only if it can be changed in different functions
Only if it can change in different functions
I don't get it) The global variable also changes in different functions. The stat.variable in this case is no different from the usual global variable. And the memory is located in the global pool. From the reference:
VariablesThere are three memory classes: static, input and extern. These memory class modifiers explicitly tell the compiler that the corresponding variables are allocated in a predefined area of memory, called the global pool.
Sometimes I come across static variables declared in the global scope in the code. I cannot understand the authors' logic.
I don't get it) Global also changes in different functions. It's no different from a regular global variable in this case. And the memory is located in the global pool. From the reference:
VariablesThere are three memory classes: static, input and extern. These memory class modifiers explicitly tell the compiler that the corresponding variables are allocated in a predefined area of memory, called the global pool.
Sometimes I come across static variables declared in the globalscope in thecode. I cannot understand the authors' logic.
Yes, you are right and there is no logic. That's just how the author of the code sees it.
My previous post wasn't thought through.
Valeriy Yastremskiy:
I don't understand the logic of the authors.
There is no logic, only schizophrenia. The expression "buttery oil" is such a polite definition of "schizophrenia".
Yes, you're right and there is no logic. It's just how the author of the code sees it.
There is no logic, only schizophrenia. The expression "oiled up" is such a polite definition of "schizophrenia".
Thanks, sometimes it's hard to find the author's logic through the code))))
yes
Could you please advise
How to return the starting lot -Lot, (to open the next order), after the execution of this part of the function:
Could you please advise
how to return the starting lot -Lot, (to open the next order), after the execution of this part of the function:
after
addStart = TimeCurrent();
with static in mql everything is running and fraught with errors. The code is always built/compiled as a whole, without intermediate obj and declaration of static is just a tribute to tradition.
If one uses static in mql - that's almost 100% from C/C++/C# world ; or one peeked and ridiculously imitates :-)
but there is also __thread__ :-)