MT4 EA that closes a trade (open or pending) after a certain period of time

Back to topics list To post a new topic, please log in or register
avatar
1
HHA94 2016.03.23 01: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!! 

avatar
13001
WHRoeder 2016.03.23 01: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)
Back to topics list  

To add comments, please log in or register