Your loop should be filtering by magic number and pair, so you don't get values from other charts.
WHRoeder:
Your loop should be filtering by magic number and pair, so you don't get values from other charts.
Your loop should be filtering by magic number and pair, so you don't get values from other charts.
That's not the problem. The code is for test purpose, there is no order on other charts.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi all,
I have two pending orders for test purpose. One is buy limit (OP_BUYLIMIT is 2), another is sell stop which is OP_SELLSTOP 5.
There are only those two pending orders, no any other orders or trades.
I put the following code in an almost empty EA, in the OnInit function,
It prints the correct information and order types.
However, if I put the code in a complicated EA, even in the OnInit function, the order type is always 4 (OP_BUYSTOP) for both two orders, though the symbol and ticket are correct. I'm 100% sure there are no any buy stop orders.
The EA includes quite a lot of code, which the size of EX4 exceeds 500 KB, and it uses a DLL which is more than 2 MB. It's so complicated that I can't post any piece of code of it.
Did any one see that OrderType returns wrong result? If so, why and how to solve it?
Thanks