urgent question please

 

hey guys...........i need a solution to the this question:

what is the syntax to write on : check if 3bars are above 13 period_EMA.

 
Assuming that:
  • All 3 bars are consecutive bars: current bar, previous bar, and previous-previous bar.
  • Above EMA means the whole bar is above EMA, ie. the low value of the bars is above EMA
The you can use the following structure:
double ema = iMA(NULL,0,13,0,MODE_EMA,PRICE_LOW,0);
bool above = Low[0] > ema && Low[1] > ema && Low[2] > ema;
if( above ) {
    // the 3 bars are above EMA13
}
Reason: