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

 
-Aleks-:

Please tell me what this warning means:

Declaration of 'm_data' hides member declaration in file 'ArrayObj.mqh' at line 16 ZigZag_rev_4.mqh 27 32

this means you're redeclaring a new variable (the same one)
 
-Aleks-:

Please tell me what this warning means:

Declaration of 'm_data' hides member declaration in file 'ArrayObj.mqh' at line 16 ZigZag_rev_4.mqh 27 32

the same variables are declared globally, if I'm not mistaken.
 
trader781:
it means you are redeclaring a new variable (the same one)
Sergey Gritsay:
Same variables declared globally, if I'm not mistaken.
Thanks, I guess the new compiler doesn't allow to do that anymore?
 
-Aleks-:
Thanks, I take it the new compiler doesn't allow this anymore?
Yes, it does. It's not an error. But the compiler warns that there may be problems and hard-to-define program errors.
 
Artyom Trishkin:
It does. This is not an error. But the compiler warns that there may be problems and program errors that are hard to detect.
Thank you.
 

A word of advice for a beginner. There is such a thing in the indicator:OnCalculate(...).

Question: Can I generate a custom event to triggerOnCalculate(...) and immediately re-calculate the indicator? Objective: not to wait for the tick to come

 
Vitaly Muzichenko:

A word of advice for a beginner. There is such a thing in the indicator:OnCalculate(...).

Question: Can I generate a custom event to triggerOnCalculate(...) and immediately re-calculate the indicator? Objective: not to wait for the tick to come

Please: either by timer or send your own event. And implement logic OnCalculate() in appropriate handlers on event arrival.
 
Alexey Kozitsyn:
Please: either by timer, or send your own event. And implement logic OnCalculate() in the appropriate handlers when the event occurs.

I can't touch it withOnCalculate(...) event, I can touch any function, but I can't touch this one. The timer is not an option, the indicator is needed not so often, and it would be better to use it with a click on a graphic item.

How to implement it?

 

Can you please tell me how to correctly look for the most resource-intensive places in the code that load the CPU?

 
Vitaly Muzichenko:

I can't touch it withOnCalculate(...) event, I can touch any function, but I can't touch this one. The timer is not an option, the indicator is needed not so often, and it would be better to use it with a click on a graphic item.

How to implement it?

Well, inOnCalculate(...) itself we track the button

if it is pressed - do the calculations, if it is not pressed - exit

at the end of calculation, press .................OBJPROP_STATE,false);

Reason: