Hello I'd like to know how to implement in my EA a code that selects all Open Orders that have moved the stop level above the entry price.
I'm thinking in something like this:
Buy Order: OrderStopLoss() > OpenOrderPrice()
Sell Order: OrderStopLoss() < OpenOrderPrice()
What have you tried to code? What are the errors being returned?
What have you tried to code? What are the errors being returned?
I'm trying something like this:
if (OrderSelect(i,SELECT_BY_POS))
if (OrderSymbol() == Symbol()){
return;}
int type = OrderType();
bool result = false;
if (OrderSymbol () != Symbol()){
if (OrderType () == OP_BUY){
if (OrderStopLoss() > OrderOpenPrice()) {
gobuy();
But apparently it only check order number one in the pool.
![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
Hello I'd like to know how to implement in my EA a code that selects all Open Orders that have moved the stop level above the entry price.
I'm thinking in something like this:
Buy Order: OrderStopLoss() > OpenOrderPrice()
Sell Order: OrderStopLoss() < OpenOrderPrice()