Вывод цвета каждый тик

[Удален]  
Здравствуйте.
Есть индикаторы, которые меняют цвет с одного на другой.
Например HMA, Slope Direction Line.
Не могу никак сделать вывод Print цвета каждый тик....

Взял индикатор НМА, который дает сигнал при смене цвета(Автор Виктор Николаев). Но там 3 цвета.
Не могу никак переработать.
//+------------------------------------------------------------------+ 
//| HMA.mq4 
//| Copyright © 2006 WizardSerg <wizardserg@mail.ru>, ?? ??????? ForexMagazine #104 
//| wizardserg@mail.ru 
//| Revised by IgorAD,igorad2003@yahoo.co.uk | 
//| Personalized by iGoR AKA FXiGoR for the Trend Slope Trading method (T_S_T)
//| Link: 
//| contact: thefuturemaster@hotmail.com 
//+------------------------------------------------------------------+
#property copyright "MT4 release WizardSerg <wizardserg@mail.ru>, ?? ??????? ForexMagazine #104" 
#property link "wizardserg@mail.ru" 

// "Modify 2008, Victor Nicolev"
// link "vinin.ucoz.ru"
// Убрал все явные ошибки, теперь индиктор можно использовать в советнике
// При использовании в осветнике обращаться к нулевому буфферу
// Убрана перерисовка

#property indicator_chart_window 
#property indicator_buffers 3
//property indicator_color1 Yellow
//roperty indicator_color2 Green 
//roperty indicator_color3 Red 
//#property indicator_width1 2
//#property indicator_width2 2
//#property indicator_width3 2

//---- input parameters 
extern int period=16; 
extern int method=3; // MODE_SMA 
extern int price=0; // PRICE_CLOSE 
extern int sdvig=0;

extern bool bPlaySound=true;           // Включение звука при смене цвета
extern bool bAllert=true;           // Включение звука при смене цвета
extern string SoundName="alert.wav";   // Звуковой файл
extern int CheckBar=1;  
//---- buffers 


//double Uptrend[];
//double Dntrend[];
double ExtMapBuffer[];

//double vect[]; 

//+------------------------------------------------------------------+ 
//| Custom indicator initialization function | 
//+------------------------------------------------------------------+ 
int init() { 
   IndicatorBuffers(4); 
   SetIndexBuffer(0, ExtMapBuffer); 
//   SetIndexBuffer(1, Uptrend); 
   //SetIndexBuffer(2, Dntrend); 
   //SetIndexBuffer(3, vect); 
   
   //SetIndexStyle(0,DRAW_LINE);
   //SetIndexStyle(1,DRAW_LINE);
   //SetIndexStyle(2,DRAW_LINE);

//   SetIndexDrawBegin(0,1*period);
//   SetIndexDrawBegin(1,2*period);
//   SetIndexDrawBegin(2,3*period);

   IndicatorShortName("Signal Line("+period+")"); 
 //  SetIndexLabel(1,"UP");
 //  SetIndexLabel(2,"DN");
   return(0); 
} 

//+------------------------------------------------------------------+ 
//| Custor indicator deinitialization function | 
//+------------------------------------------------------------------+ 
int deinit() { return(0); } 

//+------------------------------------------------------------------+ 
//| ?????????? ??????? | 
//+------------------------------------------------------------------+ 
//double WMA(int x, int p) { return(iMA(NULL, 0, p, 0, method, price, x+sdvig)); } 

//+------------------------------------------------------------------+ 
//| Custom indicator iteration function | 
//+------------------------------------------------------------------+ 
int start() { 
   if (BarChanged())
   {
      string c = snagers(1);
      Print ("string M1= "+c);
      //string c1 = snagers(5);
      //Print ("string M5= "+c1);      
      //string c2 = snagers(15);
      //Print ("string M15= "+c2);            
      
      //if (c == c1 && c1 == c2 && c2 == "green") {Print("На всех ТФ покупка!");}
      //if (c == c1 && c1 == c2 && c2 == "red") {Print("На всех ТФ продажа!");}
      //string c5 = snagers(PERIOD_M5);
      //Print ("string M5= "+c5);
    }

} 


string snagers(int tf) 
{ 
   int counted_bars = IndicatorCounted(); 
   static bool bs=false, ba=false;
   int bTime=0;
   string clr;

   if (counted_bars < 0) return(-1); 
   if (counted_bars > 0) counted_bars--;
   
   //int p = MathSqrt(period); 

   int i, limit0,limit1,limit2;
   
   limit2=Bars - counted_bars;
   limit1=limit2;
   limit0=limit1;

   if (counted_bars==0){
      limit1-=(period);
      limit2-=(2*period);
   }

//   for(i = limit0; i >= 0; i--)    vect[i]          = 2*WMA(i, period/2) - WMA(i, period); 
//   for(i = limit1; i >= 0; i--)    ExtMapBuffer[i]  = iMAOnArray(vect, 0, p, 0, method, i); 
   for(i = limit1; i >= 0; i--)    ExtMapBuffer[i]  = iCustom(NULL, tf, "Slope direction Line",0,i); 

   for(i = limit2; i >= 0; i--) 
   { 
     //Print(ExtMapBuffer[i+1]);
      //if (BarChanged())
      //{  Print("Бар закрылся");
         //clr = "";
         //Uptrend[i] = EMPTY_VALUE; 
         if (ExtMapBuffer[i]> ExtMapBuffer[i+1]) 
         {
            //Uptrend[i] = ExtMapBuffer[i];
            clr = "green";
         } 
         //Dntrend[i] = EMPTY_VALUE; 
         if (ExtMapBuffer[i]< ExtMapBuffer[i+1]) 
         {
            //Dntrend[i] = ExtMapBuffer[i];
            clr = "red";
         } 
      //}  
   }
   if (bTime<Time[0]) {
      bs=false;
      ba=false;
   }
   if (BarChanged())
   {
                if ((ExtMapBuffer[CheckBar+2]-ExtMapBuffer[CheckBar+1])*(ExtMapBuffer[CheckBar+1]-ExtMapBuffer[CheckBar])<0)
                {
                        bTime=Time[0];
                        if (bPlaySound && !bs) 
                                {
                                        PlaySound(SoundName);
                                        bs=true;
                                }
                        if (bAllert && !ba) 
                                {
                                        string mes="";
                                        if (ExtMapBuffer[CheckBar]-ExtMapBuffer[CheckBar+1]>0) mes="Смена тренда, восходящий";
                                        if (ExtMapBuffer[CheckBar]-ExtMapBuffer[CheckBar+1]<0) mes="Смена тренда, нисходящий";
                                        if (mes!="") Alert(mes);
                                        ba=true;
                                }
                }
   }
   return(clr); 
} 


bool BarChanged()
{
 static datetime dt = 0;

  if (dt != Time[0])
  {
   dt = Time[0];
   return(true);
  }
   return(false);
}

//+------------------------------------------------------------------+
[Удален]  
"Привяжитесь" к моменту смены цвета и через Case вызовите необходимую функцию. Найдите момент, где происходит перерисовка с другим цветом. Покажите его в коде.