Problem Accessing Array Values

 

Attached is an example EA that calculates a simple moving average using iMA() for a number of bars and stores the values in an array. Then, a Print() call is used to report one of the stored values from the array. Unfortunately, the values do not seem to be there. Can anyone tell me why?


Thanks,


RS

Files:
 
RhythmStar wrote >>

Attached is an example EA that calculates a simple moving average using iMA() for a number of bars and stores the values in an array. Then, a Print() call is used to report one of the stored values from the array. Unfortunately, the values do not seem to be there. Can anyone tell me why?

Thanks,

RS

You need to set up MALine[] as an indicator buffer in init(). Have a look at any other indicator code to get the typical commands used.

Paul

http://paulsfxrandomwalk.blogspot.com/