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.
- Questions from Beginners MQL5 MT5 MetaTrader 5
- What causes a position to close?
- How can I make to close positions on EA as loss target
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!
Analyze it's Close Time.
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)
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.
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()
@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?
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:
Calm friend.. ^_^
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!
Roberto Jacobs:
on MT5 you must create your own function for check CloseTime()
So?
on MT5 you must create your own function for check CloseTime()
Marco vd Heijden:
So?
Yes Marco.
So?

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