Download MetaTrader 5

How to check last orderOpentime() for each currency order.

To add comments, please log in or register
pitakn
17
pitakn  

Hello everyone

I want to create multi-currency EA but i have some problem when I want to check last orderOpentime() for each currency order

but EA will check orderOpentime() for last order in list.

TimeCurrent()-OrderOpentime() >= Timediff

OPsell(); or OPbuy();

 }

I dont know how to coding for check it.


Could anybody help?

Thank you,

Takky

whroeder1
16572
whroeder1  
pitakn:

I want to create multi-currency EA

but i have some problem when I want to check last orderOpentime() for each currency order but EA will check orderOpentime() for last order in list.

TimeCurrent()-OrderOpentime() >= Timediff


  1. Please use
SRC
    Play video
    Please edit your post.
    For large amounts of code, attach it.

    You can not use any Trade Functions until you select an order.
  2. And you want to select the last order, not the last position.
    Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum

  3. I recommend
    Do not trade multiple currencies in one EA
  4. Don't double post
pitakn
17
pitakn  
whroeder1:
  1. Please edit your post.
    For large amounts of code, attach it.

    You can not use any Trade Functions until you select an order.
  2. And you want to select the last order, not the last position.

  3. I recommend
  4. Don't double post
if(CountOrderS(OP_SELL) == 0 ||(( TimeCurrent()- OrderOpenTime() >= 500))){    
         OpenSell();       
   }


Thank sir, I'm a beginner for this website and mql4 coding. 

To add comments, please log in or register