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,
I have an EA that works well in trading accounts with some spread, but it does not function properly in trading accounts where the spread is zero. In a zero spread account, the limit orders automatically close instantly after being opened, and the EA continues to operate indefinitely. Upon reviewing the code, I discovered that there is an "if" condition that is causing the current issue. In a zero spread account, this condition evaluates to true and deletes pending orders. I'm unsure why this "if" condition is important and what its purpose is. If I remove this "if" condition, the EA works fine in both spread and zero spread accounts, but I'm concerned about potential consequences on trading performance if I remove it.
Here is the code :
Please help me understand this code and what could be the reason behind this condition closing pending orders only in zero spread accounts. Additionally, how can I rewrite this code so that it will work in zero spread accounts the same way as in spread accounts?