ArrayCopySeries function internal error

 

Hi all here!

I dont see some error in code for this i want to ask for help.

i have an indicator with following code included:

datetime TimeArray[];
int i,y;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TF); 
for(i=0,y=0; i<limit-1; i++)
{  
if (Time[i]<TimeArray[y]) y++; 
double bm0=(iBands(NULL,TF,BandPeriodeFast,BandDeviationFast,0,PRICE_CLOSE,MODE_UPPER,y)+iBands(NULL,TF,BandPeriodeFast,BandDeviationFast,0,PRICE_CLOSE,MODE_LOWER,y))/2;
etc...
}

after few hours running without problems the error start, in the exert log i see this appearing every tick:

"2011.03.18 09:46:55 i_mmr_bollinger_mtf EURJPY,M5: ArrayCopySeries function internal error"

No other errors appear....

Any suggestions, hints?

thx, eadeveloper

 

No one?

 

maybe having code that we could run would be a help

trim down your indicator (or is an EA?) to reduce clutter & just give us the minimum code that produces the problem

 
brewmanz:

maybe having code that we could run would be a help

trim down your indicator (or is an EA?) to reduce clutter & just give us the minimum code that produces the problem


its nothing dramatic, only bands are used ...

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightCyan
#property indicator_color2 Pink
#property indicator_color3 Orange
#property indicator_color4 Silver
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 1

extern int BandPeriodeFast=5;
int BandDeviationFast=2;
extern int BandPeriodeSlow=10;
int BandDeviationSlow=2;
extern int TF=30;

double UpBuffer1[];
double DownBuffer1[];
double LineUp[];
double LineDown[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
IndicatorBuffers(4);
   SetIndexStyle(0,DRAW_HISTOGRAM, 0, 2);
   SetIndexBuffer(0,UpBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM, 0, 2);
   SetIndexBuffer(1,DownBuffer1);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,LineUp);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,LineDown);
   IndicatorShortName("i_mmr_bollinger");

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }


int start()
  {
   if (TF<Period())
      {
      Comment("TF can not be more small then actual timeframe!");
      return;
      }
   datetime TimeArray[];
   int i,y;
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TF); 
   for(i=0,y=0; i<limit-1; i++)
   {  
   if (Time[i]<TimeArray[y]) y++; 
   double bm0=(iBands(NULL,TF,BandPeriodeFast,BandDeviationFast,0,PRICE_CLOSE,MODE_UPPER,y)+iBands(NULL,TF,BandPeriodeFast,BandDeviationFast,0,PRICE_CLOSE,MODE_LOWER,y))/2;
   double bm1=(iBands(NULL,TF,BandPeriodeSlow,BandDeviationSlow,0,PRICE_CLOSE,MODE_UPPER,y)+iBands(NULL,TF,BandPeriodeSlow,BandDeviationSlow,0,PRICE_CLOSE,MODE_LOWER,y))/2;
   UpBuffer1[i]=bm0;
   DownBuffer1[i]=bm1;
   LineUp[i]=bm0;
   LineDown[i]=bm1;
   }
   return;
  }
Reason: