
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
You have"possible use of uninitialised variable 'local_low'".
What does it say if
Re-read my answers from the point of view of a software company manager who has brought many software projects to market.
Otherwise, remaining at the level of "any programmer", you will not understand what the mistake is.
:) Since I will never become the head of a software company, I will forever remain at the level of "any programmer" (i.e. an amateur programmer, in my understanding).
...And since the amateur programmer never gets a logical description of the error, he concludes that either there is simply no error in his bit of code or the error is so complicated that nobody can describe it in the language of logic. At this point, we can consider that both sides understand each other, the question is over.
If the variable is initialized with anything, the warning disappears. But, as you can see for yourself, initialization of the variable local_low is redundant in this piece of code. So the warning doesn't interfere with life at all.
... The compiler will have to be as"foolproof" as possible.
... do not write if (a==true) ...
But because of the use of bool-variable interrupcion in line 9 right after initialization of variable local_low in line 8, it turns out that in line 15 the variable local_low will be guaranteed to be initialized. So at this point, the warning "possible use of uninitialized variable 'local_low'" does not mean "guaranteed" but just possible presence of a pass-through branch in which the variable is uninitialized.
If we send a request to modify a position with the same stops, we will get an error. But if you send a request to modify a pending order with the same parameters, the request will be executed. Is this the way we have planned it and we don't need to check the parameters for changes?
Why clog the server with unnecessary requests, for example, in case of an error in the Expert Advisor or incorrect logic of its operation?
In your example, if Ac-k=0 , then the for statement will not be executed at all and local_low is guaranteed uninitialized. Or is it wrong?
That's exactly right. If Ac-k<=1, the for operator must not be executed at all and the local_low variable is guaranteed to remain uninitialized. But since the bool-variable interrupcion remains false (line 3), by virtue of the condition in line 13, the uninitialized variable local_low will never (should never) be used in calculations. In particular, an expression with the variable local_low from line 15 should not be evaluated [unless, of course, the if statement works exactly as stated in the help:) ].
In other words, if the variable local_low is guaranteed to be uninitialized, it is also guaranteed not to (should not) be used in calculations.