"unmatched data error" whenever i try to use ADX

 

i have the following code on the main part of an EA:

   double pADX = iADX(NULL, 0, 5, MODE_CLOSE, MODE_MAIN, -1);
   double ADX = iADX(NULL, 0, 5, MODE_CLOSE, MODE_MAIN, 0);
   
   double pPDI = iADX(NULL, 0, 5, MODE_CLOSE, MODE_PLUSDI, -1);
   double PDI = iADX(NULL, 0, 5, MODE_CLOSE, MODE_PLUSDI, 0);
   
   double pNDI = iADX(NULL, 0, 5, MODE_CLOSE, MODE_MINUSDI, -1);
   double NDI = iADX(NULL, 0, 5, MODE_CLOSE, MODE_MINUSDI, 0);
   
   double pRSI = iRSI(NULL, 0, 5, MODE_CLOSE, -1);
   double RSI = iRSI(NULL, 0, 5, MODE_CLOSE, 0);
   //BUY
   if (RSI > pRSI &&    // RSI increasing
      ADX > pADX &&     // ADX increasing
      PDI > NDI &&      // Positive DI above negative DI
      PDI > pPDI &&      // Positive DI increasing
      NDI < pNDI)       // Negative DI decreasing
   {
      OrderSend(Symbol(), OP_BUY, 0.1, Ask, 2, Low[-1], High[-1], "", 0, 0, 0);
   }
   //SELL
   if (RSI < pRSI &&    // RSI decreasing
      ADX > pADX &&     // ADX increasing
      PDI < NDI &&      // Positive DI below negative DI
      NDI < pNDI &&     // Negative DI decreasing
      PDI < pPDI)       // Positive DI increasing
   {
      OrderSend(Symbol(), OP_SELL, 0.1, Bid, 2, High[-1], Low[-1], "", 0, 0, 0);
   }
i get "unmatched data error" whenever i try to test this. what's wrong?
 

Unmatched data error refers to the price history, not your code.

https://www.mql4.com/search/Unmatched%20data%20error

Reason: