Emergers.io

Emergers.io

Share this post

Emergers.io
Emergers.io
TOOLS: Want to know where the S&P500 will most likely close tomorrow, based on the recent price action?
Copy link
Facebook
Email
Notes
More

TOOLS: Want to know where the S&P500 will most likely close tomorrow, based on the recent price action?

This python script on Google Colab will tell you. No coding skills required.

jw | Incirrata | Emergers's avatar
jw | Incirrata | Emergers
May 07, 2023
∙ Paid

Share this post

Emergers.io
Emergers.io
TOOLS: Want to know where the S&P500 will most likely close tomorrow, based on the recent price action?
Copy link
Facebook
Email
Notes
More
5
1
Share

🤖 This code retrieves a series of price data (for an index or stock, you decide) going back X number of periods, with Y timeframe resolution.

It looks at the Z most recent data points, cycles through the whole dataset to find windows that are Z periods long and have at least A correlation with the most recent data.

It picks the B number of periods with the highest correlation, then looks at how price developed in the following C number of periods, then applies the averge of that development to the most recent datapoint (i.e. yesterday’s close) to get a price prediction for C periods into the future.

The code prompts you to set values for index, X, Y, Z, A,B and C yourself when you run it.

🤖 This python code runs on Google Colab (google’s free online editor, kind of a google docs for code) so you can run it directly there, or just copy paste into your code editor of choice.

So no coding required.

🤖 The code retrieves prices from Yahoo Finance via an API. It’s free and doesn’t require any login.

Yahoo Finance has 20+ years of free daily price data for most indexes (over 40 years for the S&P500), but not very much for lower time frames like 60m, 15m or 1m.

But you can easily adjust the code (or ask ChatGPT to help you) retrieve data from better data suppliers like AlphaVantage.

🤖 So for example, based on the past 80 days price action, the code looks for the 10 most similar periods in the past 10,000 periods (about 40 years) that shows >0.75 correlation.

The average performance following those periods suggests that the S&P will be down 1.7% in the coming 10 days.

❗️Note that this is for information purposes only and not to be relied upon for investment decisions.

Every moment in the market is unique.

❗️❗️ Please note that I can not perform any support on running or modifying this code. Just ask ChatGPT.

RUN OR MAKE A COPY OF THE CODE ON LINK BELOW

Keep reading with a 7-day free trial

Subscribe to Emergers.io to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Johan Widmark
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More