ArrayIsSeries

 

I am wondering what went wrong! here is the situation: 

writing an indicator, declaring a double array to be used as buffer, and it still shows that it is not timeseries!!

double BufferInd;

OnInit()
{
ArraySetAsSeries(BufferInd,true);


return (INIT_SUCCEEDED)
}
 
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[]
                    )
{
if(ArrayIsSeries(BufferInd))
      Print("BufferInd[] is timeseries");
   else
      Print("BufferInd[] is not timeseries!!!");

 return(rates_total);
}


 
justinmcridge: I am wondering what went wrong! here is the situation: writing an indicator, declaring a double array to be used as buffer, and it still shows that it is not timeseries!!
double BufferInd[]; // Declare as an array 

Improperly formatted code edited by moderator.

 
Your topic has been moved to the section: Technical Indicators
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
justinmcridge:

I am wondering what went wrong! here is the situation: 

writing an indicator, declaring a double array to be used as buffer, and it still shows that it is not timeseries!!

And it will never be a "series". You are using the wrong function, you probably want to use ArrayGetAsSeries().

https://www.mql5.com/en/forum/12247

What can be the utility of the function ArrayIsSeries ? - OnCalculate Function gets timeseries arrays, but there is often confusion among programmers between this function and
What can be the utility of the function ArrayIsSeries ? - OnCalculate Function gets timeseries arrays, but there is often confusion among programmers between this function and
  • 2013.05.23
  • Alain Verleyen
  • www.mql5.com
There is often confusion among programmers between this function and arraygetasseries, even in some good articles. You don't need this function to know if current element is [0], for that you need arraygetasseries(), a timeseries array can be indexed in both way independently of the fact it's a timeseries. Oncalculate function gets timeseries arrays - time[], open[], high[], low[] etc