Uninstall software and reinstall
Hopefully it ll be solved
it is very strange in visual testing mode it works well, try uninstall and re-install but still the same

How to quickly develop and debug a trading strategy in MetaTrader 5
- www.mql5.com
Scalping automatic systems are rightfully regarded the pinnacle of algorithmic trading, but at the same time their code is the most difficult to write. In this article we will show how to build strategies based on analysis of incoming ticks using the built-in debugging tools and visual testing. Developing rules for entry and exit often require years of manual trading. But with the help of MetaTrader 5, you can quickly test any such strategy on real history.
try it on another broker and see if the error is still happening
I already did that, but I realized that with latency 0 it works fine but with latency greater than that, things get complicated with errors.
thanks guys
mohanx:
Is your function called on every tick? It so, it might try to close it again in next tick, after an order was sent to the broker, but before it was actually closed.
I already did that, but I realized that with latency 0 it works fine but with latency greater than that, things get complicated with errors.
thanks guys
La_patates:
Is your function called on every tick? It so, it might try to close it again in next tick, after an order was sent to the broker, but before it was actually closed.
Is your function called on every tick? It so, it might try to close it again in next tick, after an order was sent to the broker, but before it was actually closed.
yes called on every tick.
It may be that

The Fundamentals of Testing in MetaTrader 5
- www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.

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 ,
can someone explain this error to me
I try to close all positions but every time the robot returns this error and crashes. This is the code that I use, it is a HEDGING account. thanks,