iHighest for the highest price but.... - page 2

 

Hello.

Im getting the following message when declaring the array:


'[' - invalid index value


when I do this:


double higharray[L];


L is a candle number amount that changes and it is calculated before declaring the array "higharray", it might be any number usually from 30 to 100.

 
Show the code
 
         double  jopo=44;
         double higharray[jopo];

Its not even letting me do this. probably something very basic.


Dont I need to declare the size of the array? I havent used arrays up until this point.

 
 double  jopo=44;
 double  higharray[];
 ArrayResize(higharray,jopo);
 

I just realised that you are working in MQL4

I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I will move your topic to the MQL4 and Metatrader 4 section.

 
Keith Watford:

got it, arrays need to have a defined number size or resize it if its a variable. Very thankfull sir.

 
Keith Watford:

I just realised that you are working in MQL4

I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I will move your topic to the MQL4 and Metatrader 4 section.

Oh ok, sorry and thanks again.

Reason: