Color a candle

 
Hi, I'm trying to understand how to color engulfing candles, the code that I wrote for my idea of Up trend engulfing is:
bool upEngulfing(){

   // Second Candle
   double bodyBottomOne = MathMin(Open[1], Close[1]);
   double bodyUpOne = MathMax(Open[1], Close[1]);
   double bodyOne = bodyUpOne - bodyBottomOne;
   double lowerWickOne = bodyBottomOne - Low[1];
   double upperWickOne = High[1] - bodyUpOne;
   
   //First candle
   double bodyBottomTwo = MathMin(Open[2], Close[2]);
   double bodyUpTwo = MathMax(Open[2], Close[2]);
   double bodyTwo = bodyUpTwo - bodyBottomTwo;
   double lowerWickTwo = bodyBottomTwo - Low[2];
   double upperWickTwo = High[2] - bodyUpTwo;
   
   bool conditionOne = bodyUpOne >= bodyUpTwo && bodyBottomOne <= bodyBottomTwo;
   bool conditionTwo = lowerWickOne - lowerWickTwo > 0;
   bool conditionThree = upperWickOne <= 0.10*lowerWickOne;
   bool conditionFour = bodyUpOne > upperWickTwo;
   bool isUpEngulfing = conditionOne && conditionTwo && conditionThree && conditionFour;
   
   return isUpEngulfing;
}

Now i would like all the candles in my chart are colored if these conditions are satisfied, the code that I wrote is the following:

#property indicator_buffers 2
#property indicator_color1 clrAquamarine
#property indicator_color2 clrAquamarine
#property indicator_width1 10
#property indicator_width2 10

double bodyHigh[];
double bodyLow[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- 

   SetIndexBuffer(0,bodyHigh);
   SetIndexBuffer(1,bodyLow);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   
//---
   return(INIT_SUCCEEDED);
  }
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
  for(int i = Bars-2; i>=0; i--){
  
      double bodyHh = MathMax(Close[i],Open[i]);
      double bodyLw = MathMin(Close[i],Open[i]);
      if(upEngulfing()==True){
      
         bodyHigh[i] = bodyHh;
         bodyLow[i] = bodyLw;
         
      }
  
  }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }

But it doesn't color anything. I'm new with the indicators so I'm trying to figure out how to program them. I'm using MT4, I also attach the complete file

Files:
 
  1. #property indicator_color1 clrAquamarine
    #property indicator_color2 clrAquamarine
    Use two different colors, one up, one down.

  2.   for(int i = Bars-2; i>=0; i--){
    Why are you computing all bars every tick?
              How to do your lookbacks correctly.

 
William Roeder:
  1. Use two different colors, one up, one down.

  2. Why are you computing all bars every tick?
              How to do your lookbacks correctly.

I didn't understand the second part, I iterate over the Bars for checking if there is an engulfing candlestick pattern. I don't think the for loop is the problem. 
 
It's not the problem, it is just recomputing the same thing every tick, over and over. It's your electricity.
 
William Roeder:
It's not the problem, it is just recomputing the same thing every tick, over and over. It's your electricity.
Yeah, you are right, but my question is what i need to do to plot my engulfing bars, just anything else :)
 
Previously answered.
 
William Roeder:
Previously answered.
Sorry i don't understand, can you be more explicit about how i fix my code? 
 
Previously answered #1 № 1.
 
William Roeder:
Previously answered #1 № 1.

Instead of replying me with an answer that i didn't understand why you can not be more explicit?  From the link that you sent to me i don't find the solution, I'm trying to understand how to proceed but it's not clear. Thank you

 
What part of "Use two different colors, one up, one down" is unclear? How can that be made "more explicit?"
 
William Roeder:
What part of "Use two different colors, one up, one down" is unclear? How can that be made "more explicit?"

No the problem is not the color, The problem is that when I upload the indicator on the chart, there are not colored engulfing candles! 


I already fixed the problem of the color, but this is not the reason of the problem. 

Reason: