I am trying to make a system that update moving average from google sheets.
Such as 3 months moving average. Average of 2022-03-13, 2022-02-13, 2022-01-13.
The problems are below:
- GoogleFinance function does not provide "monthly" interval.
- It excludes market-closed day of course when I try to get "daily" information.
So my idea is to use "weekly" and extract only 12 weeks such as when I try to get 3 months moving average. I took 1 month as 4-weeks simply.
=average(query(sort(GoogleFinance("QQQ","price", TODAY()-320, TODAY(),"weekly"),1,0),"select Col2 limit 12"))
I think this way is incorrect at some points. What's the better way to get it?