This what i mean

 

Do not be surprised that thesame question is rased by keylove we are thesame.

Assuming am using ema5 and 21. before place buy i will makesure that ema5>ema21on 1hour timeframe when new candle formed on 1hour then 1 will stead wait for newcandle to form on 5mins timeframe when ema5.ema21 before i place buy.My probem is how to write a new candle formation on 1 hour timeframe and new candle formation on 5mins before in a single ea . before the ea i place order. 

 
static bool     h1.isready=false;
static datetime h1.lastCandle=0;
       datetime h1.currCandle=iTime(Symbol(),PERIOD_H1,0);
static datetime m5.lastCandle=0;
       datetime m5.currCandle=iTime(Symbol(),PERIOD_M5,0);
if(h1.lastCandle==0) h1.lastCandle=h1.currCandle;
if(h1.lastCandle!=h1.currCandle){
  h1.lastCandle=h1.currCandle;
  h1.isready=true;
  m5.lastCandle=m5.currCandle;
}
if(h1.isready){
  if(m5.currCandle!=m5.lastCandle){
    h1.isready=false; 

    //PUT YOUR CODE HERE
     
  }
}

so now you have the code, so you can stop creating treads

edit: code is not tested

//z

 
and btw, i have understood well in your first post and gave you the correct hint, this is no excuse to open 2 more threads about the same thing!
 
zzuegg:
and btw, i have understood well in your first post and gave you the correct hint, this is no excuse to open 2 more threads about the same thing!

+1

V

Reason: