Download MetaTrader 5
To add comments, please log in or register
Do you know that MQL5 has classes?
HHA94
5
HHA94 2016.03.23 00:31 

Hi everyone!

 I am very new to this forum and writing EAs.  I want to know how to close an order after a certain period of time.  For example, I have placed an order at 12PM, I want it to close after 4 hours at 4PM.  Even if it is a pending order that I placed at 12, I want to close/expire after 4 hours at 4 PM regardless of whether or not it was activated.  Does a code like this exist?  Can somebody attach it or explain how to do it?  Any help would be much appreciated!

 

Thank you!! 

whroeder1
13613
whroeder1 2016.03.23 00:59  
  1. If your broker allowed an expiration time, then set it 4 hours after current and it will delete itself.
  2. Otherwise remember when you placed it and delete it (if not open)
/
To add comments, please log in or register