Posted on Leave a comment

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

🤖 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

You can run the code on this Google Colab link, but to edit you have to make a copy of it or copy paste the code into your editor of choice.

THIS RESOURCE REQUIRES A FREE SUBSCRIPTION. IF YOU WANT TO VIEW THIS RESOURCE PLEASE SIGN UP FOR A FREE SUBSCRIPTION HERE