PureBytes Links
Trading Reference Links
|
> Well MyArray is MyArray[20], not [0], is that what you meant. The array is
> full and at the close of each bar a new value is put into [0] and the value
> of [20] is disgarded and everthing moves down. So I have 19 old values and 1
> new at the close of each bar. Will what you described work for this. Thanks
> for the help.
Right. If I understand you, the new value goes into array slot [0] and
the old [0] moves to [1], etc. So you don't need to concern yourself
with any value except the newest one. You can just take an xaverage of
the newest value which is Myarray[0][0] or just Myarray[0] for short.
You have already included the other array values in the xaverage calc on
previous bars when they were Myarray[0]. Hard to be more specific
without knowing what you are trying to do. There are issues with
initializing the xaverage, etc., but that's all I have time for now.
--
Dennis
|