Every tick you call iMA and iMACD. These functions return a handle to the indicadotr, not the actual indicator data. Everytime you call them you create a new handle, but these handles are never closed, thus causing the crashes. To fix this, call these functions on the OnInit function, store their handles on a global variable and copy their actual data using CopyBuffer.
Thank you very much for your answer, as a non developer I struggle with the code logic. Copy pasting your answer allowed chatgpt to solve the problem, really powerful tool. Thanks a lot sir

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
Hello,
Please could you tell me why my PC is crashing running this particular EA from which you have the code inserted below ? All others EA I tried run fine, there is a particular problem with this one, which has been generated using ChatGPT.
Be careful if you run it in your computer as it surely will crash too, maybe due to ressource consumption ?
Thanks in advance :)