I create a function for open orders as below and shows only buy orders.
The EA allows both buy and sell orders and others remains no difference.
However, if I remove the words in red (i.e. orderType == OP_BUY and orderType == OP_SELL), both buy and sell orders are open.
Any advice why such problem happens? Much Thanks!
You should update your post and use the code button </> or Alt-s to post the code properly.
if this is for MT4 then it should have been posted in the MT4 section, if it is for MT5 then the ordertypes are wrong see the documentation.
orderType is defined as an int when passed in your function, that may work ok but you should really call it what it is an enumuration .
you don't show and therefore we cannot see what you are passing in as orderType so make sure that is correct
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I create a function for open orders as below and shows only buy orders.
The EA allows both buy and sell orders and others remains no difference.
However, if I remove the words in red (i.e. orderType == OP_BUY and orderType == OP_SELL), both buy and sell orders are open.
Any advice why such problem happens? Much Thanks!
...
...