For OPEN POSITION:
if ((ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
For PENDING ORDER:
if ((ENUM_ORDER_TYPE)OrderGetInteger( ORDER _TYPE)==ORDER_TYPE_BUY)

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
Quick question. I'm trying to convert some code from mql4 to mql5 but having some trouble.
How do I express the below conditional in mql5?
if(OrderType() == OP_BUY)
Also, is it still possible to select orders by position instead of ticket only like in mql4?