Locate the type of open positions.

 

I need to find out if the open positions on the account are either BUY or SELL positions.


With my EA they will be either one or the other but how can I interogate e.g.


if (OpenPosition() = BUY)


Please advise, fairly new to MT4


many thanks.

 
 

CB is dead on. Please take note that a pending order changes from a stop/limit to a simple buy/sell once it's activated. So for example, don't try to check your profit on a BUYSTOP order, it will always be $0 and when activated it will never be found.

.

Jon