Download MetaTrader 5

I want check that exist order pending for GBPJPY

To add comments, please log in or register
Tiago Cetto Pietralonga
541
Tiago Cetto Pietralonga  
I want check that exist order pending for GBPJPY
Thank you
Osama Shaban
1689
Osama Shaban  
bool ExistGBPJPYPosition() {
        for (int i=0; i<OrdersTotal(); i++) {
                if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
                        if (OrderSymbol()=="GBPJPY" && OrderMagicNumber()==MagicNo) {
                                return(True);
                        }
                } 
        } 
        return(false);
}
This is the main code you need. You have to do minor changes to fit your code/need !.
Tiago Cetto Pietralonga
541
Tiago Cetto Pietralonga  
Osama Shaban:
This is the main code you need. You have to do minor changes to fit your code/need !.
Thank you, it's working
To add comments, please log in or register