Probably it's an infinite loop in one of them.
Learn to use the debugger: https://www.metatrader5.com/en/metaeditor/help/development/debug
Beside that "Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you
=> Search in the articles: https://www.mql5.com/en/articles
=> Search in the codebase: https://www.mql5.com/en/code
=> Search in general: https://www.mql5.com/en/search or via Google with: "site:mql5.com .." (forgives misspelling)
- www.metatrader5.com
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.
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.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use