OrderClose(1,LotSize,Ask,3,Red);
You have to find the order ticket number to be able to close it. #1 may exist in the Strategy Tester, but nowhere else.
hello friend,
maybe try
do operator; while(expression);
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
I wanted to code an EA that would enter a trade once the moving averages cross and close when they cross again while entering the opposite trade. However, it runs fine only until it opens the second trade which will not close. Do you have an idea what is wrong with my code?