Constructor of a structure object is being called inside a working indicator and I'm not asking for that.
You state it but do not provide any evidence.
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We can't see your broken code.
Always post all relevant code (using Code button) or attach the source file.
For the question 'Is there some well known issue that might be related to my case?' - yes.
Since you did not mention 'the well known issue', I guess there is none. I've got the answer.
And then I've found the problem. It was so stupid, lol! I'm sorry.
Thank you anyway.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello.
So I have an indicator and a structure I'm using in it.
In OnChartEvent() function I call for some function of the structure. This function changes some variables inside the structure object.
It works for the first time, and for the second one constructor of the structure object is called for some reason (and the indicator stops working). The reason why I think this happens is because all variables start to contain the values I've put inside the constructor. Or they start to contain 0 when I don't use the explicit constructor.
My structure is pretty massive, with lots of other structures, functions, and arrays inside it, but I believe that my code is equal to the one below (though I didn't check the equality yet):
Unlike my code, the code above works correctly: each time you press the N-button the value of the variable 'num' becomes bigger by 1.
So, can anyone tell me, please, is there some well known issue that might be related to my case or I should better look into my code?
Also, I'm not sure, but I believe that everything was working fine on Friday and on Saturday the same code started to act like I described.
Thank you.