replacing close with an array
replacing close with an array
I have built an array with a series of numbers. I'd like to take a moving average of these numbers without having to do it manually (ex (array[0]+array[1]+.....+array[100])/100). Is there anyway I can take this same calculation using the built in function? (ex replace close with the array, xaverage(array[0])) Is this possible?
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
You can use array_sum function i.e.:
Code: Select all
var avg(0):
avg = array_sum(array, 0, 100) / 101
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times