Skip to content
ZelpuzPublic

About

Daily S&P500 forecaster

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

DSPF: Daily S&P500 forecaster

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.

Methodology

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.

Code

This app uses Python. Key third-party packages include polars and statsforecast. Trading holidays are tracked with holidays.

Usage

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.py

Output is by default sent to STDOUT. Save results by sending STDOUT to a file. For bash and similar:

$ uv run src/main.py > output.csv

For Windows PowerShell:

$ uv run src/main.py | Out-File --FilePath .\output.csv

The repo also has a makefile for users on linux systems who prefer that approach.

About

Daily S&P500 forecaster

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages