Download MetaTrader 5
To add comments, please log in or register
Have you published a program in the Market? Place it in your blog as well - the widget will help!
hornsALERT
62
hornsALERT 2014.02.04 09:20 

I get the error 1 parameter for ArraySize function must be an array with a particular broker. How could this be explained?

double _V[],_value;
if(ArraySize(_V)>0) { Print(" V value:.. ",_value," V first:.. ",_V[0]," V last:..",_V[ArraySize(_V)-1],
      " V max:..",_V[ArrayMaximum(_V,WHOLE_ARRAY,0)]," V min:...",_V[ArrayMinimum(_V,WHOLE_ARRAY,0)]); }
         
         if(ArraySize(_V)<_session) { ArrayResize(_V,ArraySize(_V)+1); }
	//Function to increment _V with 'value'
         //StartBuffer(_value,_V,ArraySize(_V));
         
         
         if(ArraySize(_V)>0) { if((_V[0]-_V[ArrayMinimum(_V,WHOLE_ARRAY,0)])/_V[0]<_rating) { Print(" value:.. ",
                            (_V[0]-_V[ArrayMinimum(_V,WHOLE_ARRAY,0)])/_V[0]," is below rating... ",_rating); return; }}
         
         if(ArraySize(_V)==0) { return; }
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.04 09:26  
BHC:

I get the error 1 parameter for ArraySize function must be an array with a particular broker. How could this be explained?

Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?
hornsALERT
62
hornsALERT 2014.02.04 09:59  
RaptorUK:
Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?


No I had not tried to resize first.

I am compiling with build 509.

hornsALERT
62
hornsALERT 2014.02.04 10:20  
RaptorUK:
Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?


Resizing before does not help
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.04 10:28  
BHC:

Resizing before does not help
OK, there should be no problem with build 509, I think you need to show more of your code . . . I can't see the cause of the error . . .
hornsALERT
62
hornsALERT 2014.02.05 12:37  
RaptorUK:
OK, there should be no problem with build 509, I think you need to show more of your code . . . I can't see the cause of the error . . .


I got this to work. I had called the ArraySize function with a variable that was not an array at some other point in my code. Thanks for the help any way.
/
To add comments, please log in or register