"but I haven't found the equivalent of PositionGetSymbol()"
Try OrderSymbol()
GumRai:
This is a basic check
Thank you very much GumRai, I will give it a try.
Best regards,
codeMolecules
codeMolecules: I've looked at the MQL4 Docs and know that PositionsTotal() is OrdersTotal(), but I haven't found the equivalent of PositionGetSymbol(). Could someone with more experience help me please? Your help will be much appreciated.
| If you really did look at OrderSelect - MQL4 Documentation then you would have seen it in the list![]() |
WHRoeder:
codeMolecules: I've looked at the MQL4 Docs and know that PositionsTotal() is OrdersTotal(), but I haven't found the equivalent of PositionGetSymbol(). Could someone with more experience help me please? Your help will be much appreciated. | If you really did look at OrderSelect - MQL4 Documentation then you would have seen it in the list |
Hello,
I ended up using the following and it worked:
for ( i = 0; i < OrdersTotal(); i++ ) { if ( OrderSelect(i, SELECT_BY_POS, MODE_TRADES) ) { if ( Symbol() == OrderSymbol() ) { //... } } }
Best regards and thank you,
codeMolecules

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
Hello forum, good day.
I started learning MQL5 before MQL4 and I'm having a bit of trouble translating an EA to MQL4. Here is where I'm stuck:
MQL5 code:
What I need to change is PositionsTotal() and PositionGetSymbol() because they don't exist in MQL4. I've looked at the MQL4 Docs and know that PositionsTotal() is OrdersTotal(), but I haven't found the equivalent of PositionGetSymbol(). Could someone with more experience help me please? Your help will be much appreciated.
Best regards and thank you in advance,
codeMolecules