goncalo:
You need to make sure you are selecting the correct Order . . . how can you identify the correct order ?
Please, your help, I need to get the OrderOpenPrice() from the first order ( from the openbuy() funtion ) into the third order ( to the openbuystop function ) and the testing is stopping at the third order, it seems not taking the OrderOpenPrice from the firts order. I thank you any help.
RaptorUK:
You need to make sure you are selecting the correct Order . . . how can you identify the correct order ?
You need to make sure you are selecting the correct Order . . . how can you identify the correct order ?
Hi Raptor, trying to select it with:
int x = OrdersTotal()-1; OrderSelect(x, SELECT_BY_POS, MODE_TRADES);
goncalo:
But is that the correct Order ? how do you know it is ? how can you verify it is the correct Order in the code ?
Hi Raptor, trying to select it with:
goncalo:
Why ? what have you verified and tested ? have you printed the relevant variables to make sure everything is correct ?
but, when testing, the EA stops running when it is suposed to open the third trade with the buystop function.
RaptorUK:
But is that the correct Order ? how do you know it is ? how can you verify it is the correct Order in the code ?
by defining the x variable, I think I can get the order selection, or is there another way to ensure that the ORDEROPENPRICE that I need, be choosen ????? I really dont know how to get it.
But is that the correct Order ? how do you know it is ? how can you verify it is the correct Order in the code ?
by defining the x variable, I think I can get the order selection, or is there another way to ensure that the ORDEROPENPRICE that I need, be choosen ????? I really dont know how to get it.
goncalo:
Please do not reply by writing in the quote box . . .Can you guarantee that the Order in the last position is the one you need ? if you can't then you need to make sure you have selected the correct one, test by Type, position size, symbol, Magic Number, OrderOpenTime() or whatever you can use to confirm it's the right one . . .
![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
Please, your help, I need to get the OrderOpenPrice() from the first order ( from the openbuy() funtion ) into the third order ( to the openbuystop function ) and the testing is stopping at the third order, it seems not taking the OrderOpenPrice from the firts order. I thank you any help.