#property  copyright "Louizos"
#property  indicator_chart_window	  
#property  indicator_buffers 1
int limit;
int init ()
  {
//----
   return(0);
  }
int deinit()
  {
   return(0);
  }
int start()
	{
   double O,C,H,L,H1,L1, BodyHigh, BodyLow;
   string text;
   int counted_bars=IndicatorCounted();
   limit=Bars-counted_bars;
   //---- Bar Checking Errors
   if(counted_bars<0) {
	  Alert("No Bars..");
	  return(-1);
   }
   //---- last counted bar will be recounted
   for(int i=1; i<limit; i++) {
	  O=iOpen(NULL,0,i);
	  C=iClose(NULL,0,i);
	  H=iHigh(NULL,0,i);
	  L=iLow(NULL,0,i);
	  H1=iHigh(NULL,0, i+1);
	  L1=iLow(NULL,0,i+1);

	   if (O>C) {
         BodyHigh = O;
         BodyLow = C;  }
      else {
         BodyHigh = C;
         BodyLow = O; }
	  
	  text="";	 
	 if(((H-L)>4*(BodyHigh-BodyLow))&&((H-C)/(0.0001+H-L)>0.6)&&((H-O)/(0.0001+H-L)>0.6)&& H1 < H)text="PinSh";
		if(((H-L)>4*(BodyHigh-BodyLow))&&((H-C)/(0.0001+H-L)<0.3)&&((H-O)/(0.0001+H-L)<0.3)&& L1 >  L)text="PinLg";
	 //if(C==O) text="Doji Pin";
	  //Write the candle type on chart
	  if(text!="")
	  {
	  ObjectCreate(DoubleToStr(i,0)+" label", OBJ_TEXT, 0, Time[i], H);
	  ObjectSetText(DoubleToStr(i,0)+" label", text, 15, "Arial", Red);
	  }
	}
}