Un recognised double value.

 

EA keeps inputing double value 

 9223372129088496176.54775808

 in array when it should not be there.

This value cannot be filtered with normal if clause e.g. this would not work

double _br=_BR[i];
            
            if(MathAbs(_br)>=1.0){
               printf(" Invalid br");}

but this does

            double _br=_BR[i];
            
            if(MathAbs(_br)>=1.0||_br==9223372129088496176.54775808){
               printf(" Invalid br");}

This happens after using the array copy function, despite initializing the recipient array with 0.0 before copying.

Has anybody had similar issue. 

 
ssn:

in array when it should not be there. 

Hello ssn,

how is your array indexed? 

ArraySetAsSeries(_BR,true);

or

ArraySetAsSeries(_BR,false);

?

 
Malacarne:

Hello ssn,

how is your array indexed? 

or

?

Hi

the array is not indexed. I always thought that was for the MqlRates arrays?...

 
ssn:

Hi

the array is not indexed. I always thought that was for the MqlRates arrays?...

So how big is your array? It would be interesting to have a little more information about how you're copying the data into your array.

For instance, could you please share how are you using the ArrayCopy function? And in case you use ArrayResize, can you give us an idea how is it working?

I mean, we need to see more relevant parts of your code if you want us to help you somehow.

Regards,
Malacarne 

 
Malacarne:

So how big is your array? It would be interesting to have a little more information about how you're copying the data into your array.

For instance, could you please share how are you using the ArrayCopy function? And in case you use ArrayResize, can you give us an idea how is it working?

I mean, we need to see more relevant parts of your code if you want us to help you somehow.

Regards,
Malacarne 

Hi Malacarne,

Well the array(s) vary in size but the largest is about 240.

I am copying using the inbuilt ArrayCopy function. Like this

//this is in a for loop            
int _start=i-(2*_size),_count=2*_size;
double _buffer_series_in[];ArrayResize(_buffer_series_in,_count);ArraySetAsSeries(_buffer_series_in,false);ArrayInitialize(_buffer_series_in,0.0);
ArrayCopy(_buffer_series_in,_buffer,0,_start,_count);

 I tried setting the buffer as a series and I got that error more often infact for each value in the array. It is only when I set the buffer as not a series that I get this double value once.

 
ssn:

Hi Malacarne,

Well the array(s) vary in size but the latest is about 240.

I am copying using the inbuilt ArrayCopy function. Like this

 I tried setting the buffer as a series and I got that error more often infact for each value in the array. It is only when I set the buffer as NOT a series that I get this double value ONCE.

So you're basically trying to copy data from the _buffer array to the _buffer_series_in array. What about the _buffer array? How is it indexed? How big is it?

Could you please post the entire for loop ? 

 
Malacarne:

So you're basically trying to copy data from the _buffer array to the _buffer_series_in array. What about the _buffer array? How is it indexed? How big is it?

Could you please post the entire for loop ? 

_buffer is the larger of the two, with size approaching 240. It is also not a series.

 

            for(int i=ArraySize(_buffer)-_size;i<ArraySize(_buffer)-1;i++){
               int _start=i-(2*_size),_count=2*_size;
               double _buffer_series_in[];ArrayResize(_buffer_series_in,_count);ArraySetAsSeries(_buffer_series_in,false);ArrayInitialize(_buffer_series_in,0.0);
               //_CMQL.Copy(_buffer,_start,_count,_buffer_series_in);
               ArrayCopy(_buffer_series_in,_buffer,0,_start,_count);
               _buffer[i]=_buffer[i-_count]-BetaRefresh(_size,_buffer_series_in,0,_count);}
 
ssn:

_buffer is the larger of the two, with size approaching 240. It is also NOT a series.

 

Please provide ALL the relevant code if you need help. Code showing the declaration, initialization and affection of all variables implied.
 
angevoyageur:
Please provide ALL the relevant code if you need help. Code showing the declaration, initialization and affection of all variables implied.

 Hi

double COrder::BetaNext(Salpha &Alpha[],Erate Rate,int Series,bool Log=false)
   {
         double _bn=0.0;
         
         double _buffer[];ArraySetAsSeries(_buffer,false);
         int _series=(int)MathPow(3.0,Series);

         //Function populates _buffer[]
         AlphaPast(Alpha,Rate,_buffer,0,_series);
         
         int _size=_series;
         
         while(_size>1){
            _size/=3;
            if(_size==1){break;}
            ArrayResize(_buffer,ArraySize(_buffer)+_size,_series);
            ArrayFill(_buffer,ArraySize(_buffer)-1-_size,_size,0.0);
            for(int i=ArraySize(_buffer)-1-_size;i<ArraySize(_buffer)-1;i++){
               int _start=i-(2*_size),_count=2*_size;
               double _buffer_series_in[];ArrayResize(_buffer_series_in,_count);ArraySetAsSeries(_buffer_series_in,false);ArrayFill(_buffer_series_in,0,_count,0.0);
               //_CMQL.Copy(_buffer,_start,_count,_buffer_series_in);
               ArrayCopy(_buffer_series_in,_buffer,0,_start,_count);
               _buffer[i]=_buffer[i-_count]-BetaRefresh(_size,_buffer_series_in,0,_count);}}  /*----*/ return (_bn);
    }
 
ssn:

 Hi

It's a treasure hunt ?

How is filled _buffer ? what is the value of Series ? ArrayCopy() is a function, why don't you check the return value ?

 
angevoyageur:

It's a treasure hunt ?

How is filled _buffer ? what is the value of Series ? ArrayCopy() is a function, why don't you check the return value ?

No its not a treasure hunt. I have reported this to service desk so I think it is a bug. I hope they address it in the next update.

 

Thanks any ways.