by Gavin » Fri Feb 23, 2018 10:33 am
When I created indicators in Excel (a long time ago) I think I had to keep a copy of the latest prices in row 1, then copy/inserted row 1 down so that it gets inserted as row 2 and moves all the other rows down. This means that the data is in descending order with the newest always at the top. The indicator then always just applied to the top 20 rows for example (rows 2 - 22) with no fancy indexing formula needed to point at them.
If you do it that way, you'll have to delete the last row of the spreadsheet every time just before doing the insert into row 2, otherwise eventually you get an error when the list gets longer than the total number of possible rows in Excel. However the total number of rows increased in Excel 2007 to 1,048,576 so you are unlikely to get that far down, but it would still make sense to limit the size of the data that you are creating, for example by always deleting row 100 if you want to never store more than 100 rows (which keeps Excel working a bit faster).
Kind regards,
Gavin