I'm currently trying to learn to code EA's and, as an exercise, I thought I'd create a basic script to tell me the range of the last 100 periods on a chart:
Now, how can I modify this script to make it tell me the average range of the past 100 periods, rather than the individual range of each period?
Thanks.
Inserted Code
int a = 0; while(a<=100) { double r = High[a]-Low[a]; r = r*10000; Alert(r); a = a+1; }
Now, how can I modify this script to make it tell me the average range of the past 100 periods, rather than the individual range of each period?
Thanks.