//------------------------------------------------------------------
#property copyright "www.forex-tsd.com" 
#property link      "www.forex-tsd.com" 
//------------------------------------------------------------------
#property indicator_separate_window
#property indicator_buffers  2
#property indicator_color1   DeepSkyBlue
#property indicator_color2   PaleVioletRed
#property indicator_width1   2
#property indicator_width2   2
#property indicator_minimum -1
#property indicator_maximum  1

//
//
//
//
//

double bull[];
double bear[];

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

int init()
{
   SetIndexBuffer(0,bull); SetIndexStyle(0,DRAW_HISTOGRAM); 
   SetIndexBuffer(1,bear); SetIndexStyle(1,DRAW_HISTOGRAM); 
   return(0);
}

//
//
//
//
//

int deinit() { return(0); }
int start()
{
   int counted_bars=IndicatorCounted();
      if(counted_bars < 0) return(-1);
      if(counted_bars>0) counted_bars--;
         int limit = MathMin(Bars-counted_bars,Bars-1);

   //
   //
   //
   //
   //
    
   for(int i = limit; i >= 0; i--)
   {
      double patternBuy  = iCustom(NULL,0,"123PatternsV6",6,i);
      double patternSell = iCustom(NULL,0,"123PatternsV6",7,i);
         if (patternBuy  != EMPTY_VALUE) bull[i] =  1; else bull[i] = EMPTY_VALUE;
         if (patternSell != EMPTY_VALUE) bear[i] = -1; else bear[i] = EMPTY_VALUE;
   }         
      return(0); 
}