Hi!
I'm operating an strategy that opens BUY-LIMIT or BUY-STOP orders.
Due to my EA limits, I need to get the information about when these orders are effected and I tried the following code:
I don't know if I really have a problem here, since every time I get the code as "0", which means a "BUY" order instead a BUY_LIMIT or BUY_STOP order.
So, is there any way I can get the specific code of these orders type, since I need to control them and not impact any other "BUY" (normal instant buy) orders?
I appreciate any help.
As I understand the orders still exist, so there are no history orders. Therefore call OrderGetInteger instead of HistoryOrderGetInteger. Furthermore, you must call OrderSelect before calling OrderGetInteger.
See https://www.mql5.com/en/docs/trading/orderselect
Also https://www.mql5.com/en/articles/211 may be helpful.![Documentation on MQL5: Trade Functions / OrderSelect Documentation on MQL5: Trade Functions / OrderSelect](https://c.mql5.com/36/79/documentation-on-mql5-trade-functions__1.png)
- www.mql5.com
As I understand the orders still exist, so there are no history orders. Therefore call OrderGetInteger instead of HistoryOrderGetInteger. Furthermore, you must call OrderSelect before calling OrderGetInteger.
See https://www.mql5.com/en/docs/trading/orderselect
Also https://www.mql5.com/en/articles/211 may be helpful.Thank you Dr Matthias, I'll try this in some days (after finish another part of code which is burning my brain).
:D
![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
Hi!
I'm operating an strategy that opens BUY-LIMIT or BUY-STOP orders.
Due to my EA limits, I need to get the information about when these orders are effected and I tried the following code:
I don't know if I really have a problem here, since every time I get the code as "0", which means a "BUY" order instead a BUY_LIMIT or BUY_STOP order.
So, is there any way I can get the specific code of these orders type, since I need to control them and not impact any other "BUY" (normal instant buy) orders?
I appreciate any help.