Retrieve 20-day, 50-day and 200-day moving averages using Googlefinance

230 Views Asked by At

I retrieve the moving averages using the Google Finance function but in several requests (one per moving average) having 200 titles to follow my method is starting to have performance problems and I would like to recover the moving averages over 20 days, 50 days and 200 days in a single query with the result in 3 different columns like this:

"MMA20" "MMA 50" "MMA 200"
   12.72 12.77 15.15

currently I use this query which I use by moving average.

=AVERAGE(QUERY(GOOGLEFINANCE($H3;"price";TODAY()-14;TODAY());"Select Col2 order by Col1 desc"))
0

There are 0 best solutions below