Scripts: Pausing execution of EA until certain time has passed

 

Pausing execution of EA until certain time has passed:

This code will get the current time , wait until a certain amount of Seconds has passed and then continue processing.

Author: buju

 

Or a simple static variable, much easier:

start(){
  static datetime Time.update;			// No open order,
  if (CurTime() < Time.update)	return(0);	// Can't trade yet.
//...
  if (!Compute()) {		                // Not good enough
    Time.update = CurTime() + X*60;	        // continue waiting X minutes.
  //Time.update = Time[0] + Period()*60;	// continue waiting for next bar.
    //...
 

I think this might be a starting point for what I am Looking for. I want to add entry and exit times to an EA. Example would be I only want to trade the EURUSD overnight from 12am EST to 6am and or for the Opening of our US Stock Market. As of right now the EA I have been testing tests 24 hrs of trading. Would appreciate any help on this. I am just learning how to code etc.


Thanks,

Jim Contant

"Jims Trading Machine"

Reason: