-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
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)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, thank you for taking the time to read this thread.
I added a new function to this program so that it only closes its own orders when trading and does not close other orders that were opened manually or opened by other expert advisors. By adding this function, the program makes only one order during Backtest and is not able to make any more trades in the Backtest. No error message can be seen in the "Journal" section. Do you know where the problem lies in the code?
The following function is newly added to the code (highlighted, Ln26-41 & Ln309-319):