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
You have to do: if(OrdersTatal() > 0) { ... }
But I may have another orders with different symbols
I need to check if I already have open position with the same symbol, if so check for trail stop if not Open position.
Use a proper order select loop. It usually looks like this. Click link below
https://www.mql5.com/en/forum/139654.
https://www.mql5.com/en/forum/145507.
You may want to read the Book so that you have an idea of Loops and Functions.
I already read most of it ... I am new with programming .... if cannot help thats OK, but please stop send me to read the book, I post here because I don't understand why it's not work for me.
Thanks.
So you want someone to write the codes for you?
No Thanks .... leave it I will find an answer by my self
Thanks any way.
But I may have another orders with different symbols
I need to check if I already have open position with the same symbol, if so check for trail stop if not Open position.
Yeah yeah, I forgot. Here is what you do:
As already pointed out, you need a proper loop for your OrderSelect, using a random number such as 12345 will achieve nothing.
These do not return price values, they return the shift of the bar with the highest and lowest values.
Use MODE_HIGH and MODE_LOW, not MODE_UPPER and MODE_LOWER