MD Hafijul: I want to store Open price of the first order in a variable.
double firstopenprice= OrderOpenPrice();
Don't declare it inside the if.
William Roeder:
Don't declare it inside the if.
MD Hafijul:
Hey, thanks for your reply. Hi all,
I am a newbie in coding and might be asking a very silly question. I want to store Open price of the first order in a variable. there might be multiple orders running simultaneously. I need to store this data so that I can set stoploss/Take profits for upcoming pending orders from this price.
I am trying something like this. But out side the if statement it doesn't seem to work.
William Roeder:
Don't declare it inside the if.
It works till I have only one open order. if I have another order open and for some reason I select that order then the value changes to the second open price's value.
![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 am a newbie in coding and might be asking a very silly question. I want to store Open price of the first order in a variable. there might be multiple orders running simultaneously. I need to store this data so that I can set stoploss/Take profits for upcoming pending orders from this price.
I am trying something like this. But out side the if statement it doesn't seem to work.
Thanks so much in advance!