This app, DSPF, generates a forecast of daily closing prices for the S&P500 as listed on the NYSE. Upon execution DSPF downloads the last five years' daily closing prices and then forecasts closing prices for the next 15 trading days, or approximately three weeks.
DSPF optionally calculates daily historic forecasts. Users can thus see both current forecasts and assess past forecast strength.
Forecasts are generated using an AutoARIMA procedure. Non-trading days are removed and trading days are treated as adjacent time steps.
As the AutoARIMA procedure is effectively deterministic, that is, you get the same result upon rerunning with the same data, we do not need to store forecasts for future evaluation. Instead, the app can generate historic forecasts at runtime. These historic forecasts do not peek; only data up to and including a trading day is used to predict subsequent trading days' closing prices.
This app uses Python. Key third-party packages include polars and statsforecast. Trading holidays are tracked with holidays.
Clone or download and unpackage the repo. I recommend using the uv package manager. Then run DSPF from the terminal:
$ cd <path-to-cloned-repo>
$ uv sync
$ uv run src/main.pyOutput is by default sent to STDOUT. Save results by sending STDOUT to a file. For bash and similar:
$ uv run src/main.py > output.csvFor Windows PowerShell:
$ uv run src/main.py | Out-File --FilePath .\output.csvThe repo also has a makefile for users on linux systems who prefer that approach.