MQL4 - automated forex trading   /  

Forum

ArrayCopySeries function internal error

Back to topics list To post a new topic, please log in or register

avatar
538
EADeveloper 2011.03.18 11:54 

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

How to Enrich Information You Present? Use Videos!

How to Enrich Information You Present? Use Videos!

How to get more information over to the viewers? There is a very simple method to prepare a video to be published on the MQL4.community website using new technologies.


avatar
538
EADeveloper 2011.03.19 15:44 

No one?


avatar
571
brewmanz 2011.03.22 07:41 

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


avatar
538
EADeveloper 2011.03.22 10:29 
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;
  }

Back to topics list  

To add comments, please log in or register