PowerShell script to archive quotes
Overview
ArchiveOldQuotes.ps1 helps reduce the size of active quote history files by moving older detailed records into archive files.
This makes the active local quote files easier to manage while still preserving older history separately.
Why Quote Archiving Exists
Portfolio Slicer usually needs:
- detailed recent quote history
- long-term historical values for older periods
Keeping full daily detail forever in the active quote files can make them unnecessarily large.
The archive script solves this by keeping the main quote file smaller and moving older detailed records into a separate archive file.
How It Works
For each symbol:
- the active quote file stays in the
Quotesfolder - the older records are moved into the corresponding
_Archive.txtfile
This works together with these settings in psConfig.txt:
ArchiveQuotesIncludeQuoteArchiveFolder
ArchiveQuotes
Controls whether archiving is used at all.
IncludeQuoteArchiveFolder
Controls whether archived quotes are included when the final Quotes.csv file is assembled.
Why This Matters
If archived quotes are not included when the final file is built, then very old history may disappear from the workbook.
That means you should understand both the archiving setting and the archive-include setting before changing them.
Practical Use
This script is most useful when:
- quote history has grown large
- you track many symbols over long periods
- you want to keep active quote files more manageable