Adx values in array

 

Hello

I have question about adx values in array. With Sar it works but with adx doess not. Any idea?

If I delete "adx[i]>20" I get alerts and arrows otherwise not. Is there any other way to store adx values into array.

for(int i = limit - 1; i >= 0; i--){
   if(sar2 == false && sar3 == false && sar4 == false){
      sar1[i]  = iSAR(NULL, Period(), Step, Maximum, i);
      adx[i] = iADX(NULL, Period(),14,PRICE_CLOSE,MODE_MAIN,i);
//============================================================
         if(s1[i + 1] < Low[i + 1] && s1[i] > High[i] && adx[i]>20){
            bearish[i] = s1[i] + 5 * Point;//       SELL__SELL__SELL
            AlertDn(s1[i]);
         }
         //----- 
         if(s1[i + 1] > High[i + 1] && s1[i] < Low[i] && adx[i]>20){
            bullish[i] =  s1[i] - 5 * Point;//      BUY___BUY___BUY
            AlertUp(s1[i]);
         }
    }        
}
 

I would start by using print to confirm what ADX values are being stored in i and i+1

V