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
1. Why is that? Harmful symptoms need to be treated, and decisively.
2. Variables, arrays and other things should not be named consistently or with language keywords (but the array "Symbol" is very striking, you can not tell if it's an array or something else in code).
1. Well, first you have to really establish whether the symptomology belongs to positive or negative manifestations. In my experience, there have been cases where I tried to change the value of a global variable in a function that wasn't supposed to do that (damned copypaste). It took me a few days to find this error. Since then, I have been using global variables in cases when I cannot do without them in principle.
2. I agree. But if they are used within one function, it doesn't bother me. But global variables with such names are really a source of future confusion.
I'll repeat my question though.
Is it possible to determine the triggering of OnInit inside of OnTick?
For example, can I declare a static variable inside OnTick that stores the number of times the EA is initialized (if MQL5 has such property or a similar one)?
I must be paranoid. I don't like public (global) variables. I consider it a muveton.
Global variables are at least visible from afar. But hiding serious cumulative variables inside functions in statics is a way of carefully spreading a rake for oneself. This is the first time I've seen an accumulative static array hidden inside a function in such a way. This is a fiery rake.
Use classes - they will leave the global level clean, hide all the guts and get rid of crutches.
I'll repeat my question though.
Is it possible to determine OnInit triggering inside of OnTick?
For example, can we declare a static variable inside OnTick that stores the number of initializations of the EA (if there is such or similar variable in MQL5)?
It is possible not only to count the number of OnInit triggers, but also to determine why the initialization occurred (implementation is another issue).
Are you familiar with _UninitReason, for example?
Need to write a WorkSymbols class.
Methods:
string GetSymbol[];
bool UpdateSymbols(inWorkSymbols);
bool UpdateSymbolsStatus();
int GetSymbolCount();
Apologies if the request is cheeky... I'll be trying to figure it out myself too.
Yes, it seems a mistake to combine the symbol change and timeframe condition.
I am also in favour of separating them into two conditions. The ticket has already been placed in the service desk.
Sort of cooked it up. Criticism is welcome.
The only thing I don't like here is the "live" resizing of the array containing the working data.
Question for the developers, is it guaranteed that the previously entered user data in the dynamic array being modified will be preserved under the following condition?
The only thing I don't like here is the "live" resizing of the array containing the working data.
Question for the developers, is it guaranteed that the previously entered user data in the dynamic array being modified will be preserved under the following condition?