Bar count ignoring all types of DOJIs.

 

Hi folks! I am not a programmer! Can someone help me out to set  this code up  in order to ignore all types of the DOJIs? Much oblied


#property copyright "Copyright © 2010, Stephen Ambatoding."
#property link      "sangmane@forexfactory.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Tomato

extern int MinCount = 8;

double UpArrow[], DnArrow[];
string LastObjName;
datetime LastTime;

int init()
  {
//---- indicators
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);
   SetIndexBuffer(0,UpArrow);
   SetIndexBuffer(1,DnArrow);   
   IndicatorDigits(Digits+1);
   LastTime = Time[Bars-1];
//----
   return(0);
  }
  
int deinit()
  {
    DelObj();
    return;
  }  

int start()
  {
   int i, k, cnt, iflat,limit, counted_bars=IndicatorCounted();
   string ObjName;
   if(counted_bars==0)
   {
     for(i=Bars-1; i>=0; i--)
     {
       UpArrow[i] = EMPTY_VALUE;
       DnArrow[i] = EMPTY_VALUE;
     }
     LastObjName = "";
     LastTime = Time[Bars-1];
     DelObj();
   }   
   bool Found;
   if(counted_bars>0) counted_bars--;
   limit = Bars-counted_bars-1;   
   
   for(i=limit; i>=0; i--)
   {
     k = i+1;
     if(Close[k]>=Open[k])
     {
       //search for successive downbars
       cnt = 0;
       k++;
       while(True)
       {
         if(Close[k]>=Open[k]) break;
         cnt++;
         if(cnt>=MinCount) break;
         k++;
         if(k>=Bars-1) break;         
       }
       if(cnt>=MinCount)
       {         
         UpArrow[i+1] = High[i+1]+0.5*iATR(NULL,0,21,i+1);
         ObjName = WindowExpertName()+"_"+Time[i+1];
         if(ObjectFind(ObjName)<0)
         {
           LastObjName = ObjName;
           ObjectCreate(ObjName,OBJ_TREND,0,Time[i+1],Close[i+1],Time[i],Close[i+1]);
           ObjectSet(ObjName,OBJPROP_COLOR,Tomato);
           ObjectSet(ObjName,OBJPROP_RAY,False);
         }
       }
     }
     else
     {
       //search for successive upbars
       cnt = 0;
       k++;
       while(True)
       {
         if(Close[k]<Open[k]) break;
         cnt++;
         if(cnt>=MinCount) break;
         k++;
         if(k>=Bars-1) break;         
       }
       if(cnt>=MinCount)
       {
         DnArrow[i+1] = Low[i+1]-0.5*iATR(NULL,0,21,i+1);
         ObjName = WindowExpertName()+"_"+Time[i+1];
         if(ObjectFind(ObjName)<0)
         {
           LastObjName = ObjName;
           ObjectCreate(ObjName,OBJ_TREND,0,Time[i+1],Close[i+1],Time[i],Close[i+1]);
           ObjectSet(ObjName,OBJPROP_COLOR,DodgerBlue);
           ObjectSet(ObjName,OBJPROP_RAY,False);
         }
       }         
     }
     if(Time[i]>LastTime)
     {
       LastTime = Time[i];
       if(ObjectFind(LastObjName)>=0)
       {
         ObjectMove(LastObjName,1,Time[i],ObjectGet(LastObjName,OBJPROP_PRICE1));
       }       
     }
   }
   return;
 }

void DelObj()
{
  for(int i=ObjectsTotal()-1; i>=0; i--)
  {
    string ObjName = ObjectName(i);
    if(StringFind(ObjName,WindowExpertName(),0)>=0)
      ObjectDelete(ObjName);
  }
  return;
}
 
Hello you can open a job here: https://www.mql5.com/en/job
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
I would like to add one filter. The bar (1st bar) which breaks BB 2.0 upper band, closed above stoch 80, and rsi not above 70, should fulfill one more condition: when that bar closes ATr should be below a moving average applied to the ATR value. Hello, There is one Fuzzy logic library in mql5 website: https://www.mql5.com/en/code/13717 This...