Hey guys just trying to build a simple Average Daily Range calculation into an array that I can access. Can you check what i've built and see if there is a more efficient way to do this? I'm not great at coding but i've tried to place a for loop to build out the absolute values of the H/L calculation: ABS(High[i]-Low[i]) so i can store the daily ranges over the past days. But i'm running into issues actually calculating the average of those values and getting some Array out of range errors.
https://fxdreema.com/shared/bOxV5GF1c
I know the math behind what i'm trying to build but I obviously don't have the second loop correct in some fashion.
ADR = (DR[1] + DR[2] + DR[3] + DR[4] + DR[5]) / Days_To_Avg
I'm getting stuck in adding them all together before I average them I think.
Also, how can I call the value of the DR array in a condition block? Do i need to do another block to modify a new variable before I can compare it in a condition? (I'm not aware of a way to call a value of an array in the condition block?