Waiting for set number of bars before placing an order? Please help? Video Inside. - page 3

 
DomGilberto:

No that is what I want? I dont want to buy on the cross of the 12 EMA's. I already had that coded (first step of learning the ropes and getting something down.)

 What I want is price to be above all the EMA's (12 of them) and then price to pull back to a pre-defined EMA and then an order gets placed above the highs. The order then cancels should price close beneath the 60 ema (which in the case of a long would be the furthest EMA from price.)

 

Why? Am I missing something? 

OK,  perhaps we/I have crossed lines,  pun not intended.   
 
Ok, looking for a little more help if possible. 

for (int s=0; s < Bars; s++)
   {
   double s1  = iMA(NULL,60,3,0,1,0,0); 
   double s2  = iMA(NULL,60,5,0,1,0,0);
   double s3  = iMA(NULL,60,8,0,1,0,0);
   double s4  = iMA(NULL,60,10,0,1,0,0);  
   double s5  = iMA(NULL,60,12,0,1,0,0);
   double s6  = iMA(NULL,60,15,0,1,0,0);  
   double s7  = iMA(NULL,60,30,0,1,0,0);
   double s8  = iMA(NULL,60,35,0,1,0,0);
   double s9  = iMA(NULL,60,40,0,1,0,0);
   double s10 = iMA(NULL,60,45,0,1,0,0);
   double s11 = iMA(NULL,60,50,0,1,0,0);
   double s12 = iMA(NULL,60,60,0,1,0,0); 
      
       if(s1<s2)
        if(s2<s3)
          if(s3<s4)
            if(s4<s5)
              if(s5<s6)
                if(s6<s7)
                  if(s7<s8)
                    if(s8<s9)
                      if(s9<s10)
                        if(s10<s11)
                          if(s11<s12)OrderEntry(1);
                           // Not sure about the continue? Or was that for me?
     } 

The "OrderEntry(1)" is tied to pushing out an order on the basis of the if statements, working with the iMA settings. That's straight forward.

Should I replace the "OrderEntry" with a custom word that works with iBarShift to give me the time at which all the if statements are true? If that's the case, how can I use this to then set a rule that as long as price is above the 60 EMA, place an order above the highest bar found from when the MA's first crossed in the correct order, relative to the if lines?

 

Again, would appreciate anyones help. :) 

Reason: