Indicator with 32 lines of code. Why does it keep displaying 2147483647?

 

Actually, it's putting 2147483647 in front of what the actual indicator value is.  Can you help?  I can't figure it out.  My code below is for MT4.

NOTE:  I've number 2147483647 is significant because it shows up when you max out the "Max bars in history" or "Max bars in chart" of the MT4 Options Chart screen (image below).  If you fill either of those with all 9's, click OK, then reopen the Options window back up again, you will see then see number 2147483647.  FYI, the indicator still doesn't display properly even though I have both "Max bars in history" and "Max bars in chart" set to 2000.

MT4 Options

#property copyright "Rashad Campbell"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_minimum 0

double BID_up_bucket[], previous_bid = 0;

int OnInit()
{
   IndicatorDigits(Digits);
   SetIndexBuffer(0,BID_up_bucket);
   SetIndexStyle(0,DRAW_ARROW,OBJ_ARROW_UP,2,clrRed);
   SetIndexLabel(0,"BID Up");
 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( (Bid > previous_bid) && (previous_bid != 0) )
   {
      BID_up_bucket[0] += (Bid - previous_bid);
   }

   previous_bid = Bid;

   return(rates_total);
}
 
Rashad C.: Actually, it's putting 2147483647 in front of what the actual indicator value is. 
  1. 2147483647 is EMPTY_VALUE
  2. Since all you do is increment buffer[0], change the default to zero. SetIndexEmptyValue
 
William Roeder:
  1. 2147483647 is EMPTY_VALUE
  2. Since all you do is increment buffer[0], change the default to zero. SetIndexEmptyValue

And just like that.  It's fixed.  Thank you.  I must have only done the search for 2147483647 in the Index tab of MQL Reference instead of the Search tab.  "That's what happens when you code when sleep deprived."  But, I will admit that I don't think I would have realized what I was looking at had I saw this on my own.  After reading the definition of EMPTY_VALUE and SetIndexEmptyValue in the MQL Reference, this all makes sense now.  THANKS AGAIN.

I'm about to finish this indicator RIGHT NOW, so that I can test it.

How can I repay you?

Reason: