Download MetaTrader 5

User defined array, not getting a value

To add comments, please log in or register
miko.szy
35
miko.szy  

Hi,

I have a wired problem with my array.

I used to be a programmer, and I never had this kind of problem before...

Do I need something special to use array in EA?

Below is simply not working.

Chinkou_Buffer[i]=Close[i]

When I Print() these three values, i and Close[i] have values.

Chinkou_Buffer[i] is decleared as double, which is same as Close.

Your advice is much appreciated!

Keith Watford
Moderator
10635
Keith Watford  
Have you sized the array?
Simon Gniadkowski
Moderator
18021
Simon Gniadkowski  
miko.szy:

Hi,

I have a wired problem with my array.

I used to be a programmer, and I never had this kind of problem before...

Do I need something special to use array in EA?

Below is simply not working.

Chinkou_Buffer[i]=Close[i]

When I Print() these three values, i and Close[i] have values.

Chinkou_Buffer[i] is decleared as double, which is same as Close.

Your advice is much appreciated!

Is it a buffer in an Indicator or an array in a Script/EA ? for an array you have to declare it with a fixed size or ArrayResize() it . . .
To add comments, please log in or register