Adding simple Order entry Delay?

 

I have been trying to figure out how to put in a time or bar delay for a Market Order entry. I have seen

a lot of examples.But as I have said before, because there are many ways of doing the code and many

doing it, just makes it harder for me and some others still learning the code. What I am trying to do is:

add a time Delay on a 1 minute chart entry. For example : Order entry + 9min = New Order entry. Or it

could be 9 bars because it will always be a 1 min. chart used for order entry criteria. This is a scalp EA

that uses multiple currency alignment. external double delay = 9.0;

JimTrader1

 
  1. Bar delay
    static datetime LastEntryDetected;
    int iBar = iBarShift(NULL,0, LastEntryDetected);
    if (delay = iBar){ 
       // open now
    }
    else{
       // test for entry
       if (condition) LastEntryDetected = Time[0];
    }

  2. Time delay
    static datetime LastEntryDetected;
    if (TimeCurrent() > LastEntryDetected + delay * Period() * 60){
       // open now
    }
    else{
       // test for entry
       if (condition) LastEntryDetected = Time[0];
    }
 
How can I open a trade with this indicator attached below?
Files:
 
Mafeng:
How can I open a trade with this indicator attached below?

You can't trade from an Indicator . . .

DON'T hijack someone else's thread, start your own.

Reason: