You can check in orderhistory if already exists an order with that specific open order price
Thanks for ur replay,
can you give me an example of code ? i'm a newer in mql community :-)
How may of these entry price levels do you have?
An easier way would just be to use a boolean variable to check if that level has been traded or not
double level = 0.7867; // or whatever price you want to enter bool levelTraded = false; if (!levelTraded && Bid == level) { OrderSend(Symbol(),OP_SELL,1,Bid,0,0,0,"level traded",123456,0,clrBlue); levelTraded = true; }
It will only trade at that level once, until you restart the EA.
How may of these entry price levels do you have?
An easier way would just be to use a boolean variable to check if that level has been traded or not
It will only trade at that level once, until you restart the EA.
You can check in orderhistory if already exists an order with that specific open order price.
Because of slippage, an order may not have been opened at the exact price.
How may of these entry price levels do you have?
An easier way would just be to use a boolean variable to check if that level has been traded or not
double level = 0.7867; // or whatever price you want to enter bool levelTraded = false; if (!levelTraded && Bid == level) { OrderSend(Symbol(),OP_SELL,1,Bid,0,0,0,"level traded",123456,0,clrBlue); levelTraded = true; }
It will only trade at that level once, until you restart the EA.
Doubles are rarely equal.
Because of slippage, an order may not have been opened at the exact price.
Of course it's mandatory to declare an amount of tolerance points because also 2 pending orders placed at the same price can be executed with some points of difference.
True, but MT5 it is possible to check with requested price in history.
Thanks, I didn't realise that. I'm still not so hot with MQL5
Doubles are rarely equal.
True.
Bid >= Level
Would be better for a Sell limit.
Bid <= Level
For a Sell Stop

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I'm coding an EA that opens orders with TP and SL when a price is hit.
I don't want the EA to reopen any other orders if the same price is hit a second time.
how can i control that ?