![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Nice. Looks good to me everything but
when I run this code
it says Error = 4753 which means position not found.
When I use
it still gives the same error.
I tried the Print statement that you added in, and for some reason it returns the error when it is placed where you have it in the code when the code itself otherwise works, but it is in the true statement, so when it's executed, it might be trying to find an error because it has been called to do so, but i don't know for sure. However, put the Print statement by itself like this
That way it only looks for an error if the position couldn't be selected. This worked for me when i tried it. Something else you should have for the code is an if statement like this
The statement makes sure that there are positions to be selected before the code is run. I hope all of this helps.
if(PositionsTotal()>0){
}
Looks like working.
Thanks you, guys, for your kind help.
Hello,
How to use this code for stocks? I saw all trail stop ea includes NomalizeDouble. For stocks, price close is integer and for example price step is 25. Close like 1000 1025 1050 1075.
thanks.