So I'm trying to find the highest value and the lowest value from the last 52 trading days. And then I'm taking these two numbers and adding them together and then dividing them by 2. I just want the output value of this formula, but I'm unsure if I'm doing this correctly or not. Here's the code that I'm using in my backtest.
I'd appreciate any help, thanks.