Hi,
I want to ask about selecting position by ticket function. My EA is multi-currency EA and I store each buy ticket and sell ticket to BuyTicket[] and SellTicket[] Array.
Usually when I want to select a position I will use loop through all open position and select each position by the ticket then filter it using position.Symbol(), position.Magic() and position.PositionType().
I think this method is something unnecessary step since I already save buy ticket and sell ticket. Instead looping all through all open position I want to select it only using the ticket. My question is since I already have the ticket that I want to work with, should I loop through all open position or can I just select the position and working on it?
e.g.
note: no selection of symbol, magic number or position type
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I want to ask about selecting position by ticket function. My EA is multi-currency EA and I store each buy ticket and sell ticket to BuyTicket[] and SellTicket[] Array.
Usually when I want to select a position I will use loop through all open position and select each position by the ticket then filter it using position.Symbol(), position.Magic() and position.PositionType().
I think this method is something unnecessary step since I already save buy ticket and sell ticket. Instead looping all through all open position I want to select it only using the ticket. My question is since I already have the ticket that I want to work with, should I loop through all open position or can I just select the position and working on it?
e.g.
note: no selection of symbol, magic number or position type