Managing with multiple positions?

 
I want to make robot what makes multiple positions simultaneously. They are with StopLosses ant TakeProfits. How I can with robot check what position is still opened and what position is already closed (price passed SL or TP) ? PositionSelect(Symbol) selects as if only one position.
 
Analyze it's Close Time.
 
Marco vd Heijden:
Analyze it's Close Time.
I did not test yet, but it seems that it can be done with PositionSelectByTicket() command. It supposedly returns false when position is already closed. But thank you anyway!
 
SteelAce: I did not test yet, but it seems that it can be done with PositionSelectByTicket() command. It supposedly returns false when position is already closed. But thank you anyway!
@Marco vd Heijden has already given you the correct and official procedure - namely looking at the CloseTime! Why are you looking for an untested method?
 
SteelAce:
I want to make robot what makes multiple positions simultaneously. They are with StopLosses ant TakeProfits. How I can with robot check what position is still opened and what position is already closed (price passed SL or TP) ? PositionSelect(Symbol) selects as if only one position.
Use DEAL_POSITION_ID and check the DEAL_ENTRY (IN or OUT)
 
Fernando Carreiro:
@Marco vd Heijden has already given you the correct and official procedure - namely looking at the CloseTime! Why are you looking for an untested method?
on MT5 you must create your own function for check CloseTime()
 
Roberto Jacobs: on MT5 you must create your own function for check CloseTime()

I had just finished answering another post about MT4 and my mind was still in MQL4 mode. Sorry about that!

EDIT: Note to self - I should really pause to think before posting so hastily next time!

 
Fernando Carreiro:

I had just finished answering another post about MT4 and my mind was still in MQL4 mode. Sorry about that!

EDIT: Note to self - I should really pause to think before posting so hastily next time!

Calm friend.. ^_^
 
Roberto Jacobs:
on MT5 you must create your own function for check CloseTime()
So?
 
Marco vd Heijden:
So?
Yes Marco.
Reason: