How do i iterate over the '1Min' and get the previous '5Min' value?
1Min 5Min
IndexX
2016-01-03 23:00:00 5 100
2016-01-03 23:01:00 6 NaN
2016-01-03 23:02:00 7 NaN
2016-01-03 23:03:00 8 NaN
2016-01-03 23:04:00 9 NaN
2016-01-03 23:05:00 10 200
2016-01-03 23:06:00 11 NaN
2016-01-03 23:07:00 12 NaN
2016-01-03 23:08:00 13 NaN
2016-01-03 23:09:00 14 NaN
2016-01-03 23:10:00 15 300
So if I am at IndexX '2016-01-03 23:08:00' and I wanted to add its '1Min' value (13) with the last '5Min' value (at IndexX '2016-01-03 23:05:00' = 200) or even the one previous to that (at IndexX '2016-01-03 23:00:00' = 100).
Basically for each '1Min' value I want to calculate a moving average on the '5Min' values but starting at a shifted 'IndexX'.
The 1Min and 5Min is arbitrary and I would like to calculate on different timeframes too. So it could be 5Min and 60Min or 1440Min.