Getting the symbol of an open position and comparing it to the symbol of the chart the expert advisor is attached to
Have you been reading the documentation? If you just scan the Trade Functions you can quickly see the answer:
Or if you already have a ticket number selected, then use PositionGetString() with POSITION_SYMBOL.
![Documentation on MQL5: Trade Functions / PositionGetSymbol Documentation on MQL5: Trade Functions / PositionGetSymbol](https://c.mql5.com/36/54/documentation-on-mql5-trade-functions.png)
- www.mql5.com
Have you been reading the documentation? If you just scan the Trade Functions you can quickly see the answer:
Or if you already have a ticket number selected, then use PositionGetString() with POSITION_SYMBOL.
i must have missed it but i had only tried the POSITION_SYMBOL without first getting the ticket number and it kept returning the implicit conversion from number to string error. Thanks it has worked now.
i must have missed it but i had only tried the POSITION_SYMBOL without first getting the ticket number and it kept returning the implicit conversion from number to string error. Thanks it has worked now.
![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