My ea is not working, I am trying to find resistance and support lines however there is no trades happening

 

Any help would be much appreciated.


//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

// Ask & Bid
double Ask= NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK) , _Digits);
double Bid= NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID) , _Digits);


// Candlesticks stored
 double id[];
 
   
// Price Array
MqlRates PriceInfo[];
ArraySetAsSeries(PriceInfo,true);
int PriceData=CopyRates(_Symbol,_Period,0,101,PriceInfo);
int count=0;
double min;
double low;
for(int y=low;   y<=min;y=y+0.00001){
for(int i=2;i<=100;i++){
if(y>PriceInfo[i].low&&y>MathMin(PriceInfo[i].close,PriceInfo[i].open)){
if(id[1]==0){
id[1]=PriceInfo[i].low;
}
if(id[2]==0){
id[2]=PriceInfo[i].low;
}if(id[3]==0){
id[3]=PriceInfo[i].low;
}if(id[4]==0){
id[4]=PriceInfo[i].low;
}
}
if(y<=MathMax(PriceInfo[i].close,PriceInfo[i].open)&&y>=MathMin(PriceInfo[i].close,PriceInfo[i].open))
id[1]=0;
id[2]=0;
id[3]=0;
id[4]=0;
break; 
if(id[1]!=id[4] && id[3]!=id[4] && id[2]!=id[3]){
trade.Buy(0.01,NULL,Ask,MathMin(MathMin(id[1],id[2]),MathMin(id[3],id[4])),Ask+2*(Ask-MathMin(MathMin(id[1],id[2]),MathMin(id[3],id[4]))),NULL);
id[1]=0;
id[2]=0;
id[3]=0;
id[4]=0;
}
}

}   
  }
//+------------------------------------------------------------------+
 
  1. Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
  2.  double id[];
    ⋮
    if(id[1]==0){ id[1]=PriceInfo[i].low; }
    if(id[2]==0){ id[2]=PriceInfo[i].low; }
    if(id[3]==0){ id[3]=PriceInfo[i].low; }
    if(id[4]==0){ id[4]=PriceInfo[i].low;
    Why do you expect these if statements to ever be true?
Reason: