Candle colour array - why won't it work?

Harry Wright  

Hi guys,

I'm relatively new the world of MQL4 and can't seem to wrap my head around why my array won't work. It just simply isn't alerting me to the colour of the specified candle!

Any ideas why this won't work?

void OnStart()
{
   int shift = 20;
   string candleColourArray[];
   while(shift > 0)
   {
      if(Open[shift] < Close[shift])
      {
         candleColourArray[shift] = "Green";
         shift = shift - 1;
      }
      else 
      {
         if(Open[shift] > Close[shift])
         {
            candleColourArray[shift] = "Red";           
            shift = shift - 1;
         }         
      }
   }
   Alert(candleColourArray[5]);   
}
Mohamad Zulhairi Baba  
Harry Wright:

Hi guys,

I'm relatively new the world of MQL4 and can't seem to wrap my head around why my array won't work. It just simply isn't alerting me to the colour of the specified candle!

Any ideas why this won't work?

color color1 = clrNONE;
color1 = clrGreen;
Reason: