my expert returns wrong value of my indicator

 

hi guys , i wrote an indicator, and when i use it in expert in strategy tester, it just comment me true valumes for only 5-6 candles. then it comment a fixed wrong value like 2147483647.00

void OnTick()
  {
  if(NormalizeDouble(Volume[1],0)<=200 && NormalizeDouble(iCustom(Symbol(),PERIOD_M5,"taghir hajm",1,1),2)>=0.15)
   //{
   // Comment(Volume[1]+"hiiiiiii");
  Comment("fallll = "+DoubleToStr(NormalizeDouble(iCustom(Symbol(),PERIOD_M5,"taghir hajm",1,1),2),2));
  // }
  }
 
  1. 2147483647.00  is EMPTY_VALUE.
  2. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. We can't see your indicator.

 
William Roeder #:
  1. 2147483647.00  is EMPTY_VALUE.
  2. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. We can't see your indicator.

sorry im new

#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_minimum    -0.2
#property indicator_maximum    0.2
#property indicator_buffers 2
#property indicator_width1  2
#property indicator_color1  Silver
#property indicator_color2  Red
#property indicator_level1    -0.03
#property indicator_level2     0.03
#property indicator_levelcolor clrRosyBrown
#property indicator_levelstyle STYLE_DASH
 double    ExtNesbatBuffer[];
 double  ExtTanasobBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(0,ExtNesbatBuffer);
    SetIndexBuffer(1,ExtTanasobBuffer);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate( 
                 const int rates_total,
                 const int prev_calculated,
                 const datetime& time[],
                 const double& open[],
                 const double& high[],
                 const double& low[],
                 const double& close[],
                 const long& tick_volume[],
                 const long& volume[],
                 const int& spread[])
               
                
  {
    //Comment("rotates = "+ IntegerToString(rates_total,0,0) + "prev = "+IntegerToString(prev_calculated,0,0));
   int i,limit;
//--- last counted bar will be recounted
   limit=rates_total-prev_calculated-1;
   if(prev_calculated>0)
    limit=1;
//--- macd counted in the 1-st buffer
   for(i=0; i<limit; i++)
      {
          ExtNesbatBuffer[i]=fabs(iClose(Symbol(),0,i)-iOpen(Symbol(),0,i))*80000/(iVolume(Symbol(),0,i));
           if(ExtNesbatBuffer[i]>0.2)
             {
              ExtNesbatBuffer[i]=0.2;
             }
              if(ExtNesbatBuffer[i]<-0.2)
             {
              ExtNesbatBuffer[i]=-0.2;
             }
          ExtTanasobBuffer[i]=(StringToDouble( IntegerToString(iVolume(Symbol(),0,i)))/StringToDouble( IntegerToString(iVolume(Symbol(),0,i+1)))-1)/3;
             if(ExtTanasobBuffer[i]>0.2)
             {
              ExtTanasobBuffer[i]=0.2;
             }
              if(ExtTanasobBuffer[i]<-0.2)
             {
              ExtTanasobBuffer[i]=-0.2;
             }
       }
       // Comment("rotates = "+ rates_total + "prev = "+prev_calculated);
       
//--- return value of prev_calculated for next call
   return(rates_total);
  }

this is the indicator

 
   for(i=0; i<limit; i++)
      {
          ExtNesbatBuffer[i]=fabs(iClose(Symbol(),0,i)-iOpen(Symbol(),0,i))*80000/(iVolume(Symbol(),0,i));

Your loop is indexing as non-series. Your buffers and function calls are indexed as-series.

See How to do your lookbacks correctly #9#14 & #19.