AI short term trend prediction of SP500 components

Discussion in 'Stock Market Today' started by mech.trader, Jul 4, 2021.

  1. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    Hi there, I'm going to post here daily, for a few weeks, my AI generated predictions for the SP500 components.

    • What data is used?
    Only End-Of-Day trading data is used (Open, High, Low, Close, Volume)

    • What is predicted?
    Short-term trend expressed as the percentage change in the simple-moving-average of the last 5 days (MA5) vs the MA5 calculated 5 trading days into the future.
    For example, if today is Friday, today's MA5 will be calculated over the most recent 5 days (Mon-Tue-Wed-Thu-Fri) and the prediction will be the percentage change in MA5 today vs MA5 calculated next Friday.

    • How to read the prediction?
    The primary components of the prediction [Move Probabilities and Average Magnitude] will give you the Probability/Chance of a move together with the statistical mean of the magnitude of the move. Primary components are split in Win/Neutral/Loss. Of course Win/Loss different meaning depending on the position taken Long/Short.
    The primary components are summarised in a single figure [Directional % Change] to give the statistical magnitude of the predicted change. Positive for up-trend, negative for down-trend.

    • What algorithm do I use?
    I use a machine learning algorithm that has 38 inputs, all based on technical indicators that are derived from the EOD data.

    • How much data is used for training / testing the ML algorithm?
    EOD data has been collected for a few thousands stocks across EU/US/AUS for the 1998 - 2021 (or shorter) period so the ML algorithm has learnt both from good times and bad times. In total I have a bit over 6 million patterns for training and 2 million for validation.

    • What R-squared did you get on the validation data?
    Explained Variance Score is 0.34649
    R2 Score is 0.34641

    • How often will you be posting the predictions
    For the next 4 weeks, I'll make sure to post once a day (Mon-Fri) at most 2 hours after the US markets close

    • Why am I doing this?
    There are a few reasons that come to mind: validation of the algorithm, feedback from other members, socialising, improvements ideas, etc.


    Attached here is the SP500 predictions as of Friday 2-nd of July - EOD. Any feedback is greatly appreciated.


    Note: I cannot make any promises regarding those predictions, investment in stock market is a high risk activity and majority of short term traders lose in the long run.


    Cheers.
     

    Attached Files:

    #1 mech.trader, Jul 4, 2021
    Last edited: Jul 4, 2021
    TomB16 likes this.
  2. ddebrazza

    ddebrazza Active Member

    Joined:
    Jun 23, 2021
    Messages:
    472
    Likes Received:
    141
    Do you mind explaining how to read your pdf?

    I am always interested to see how other people think and calculate things
     
  3. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    What I'm predicting is the % increase (+) or decrease (-) of the MA5 as calculated today vs MA5 calculated on the last day of the following 5 days. So say today is Friday, the today's MA5 is calculated over the Mon-Tue-Wed-Thu-Fri period and the estimate tells the % change to expect by next Friday - a pretty good estimate of the trend.

    [​IMG]
    In the image attached, I've plotted the Close in blue while the MA5 in yellow. I've marked on the chart in green 2 long entry points where the estimated % change would indicate that an increase in the MA5 is expected and implicitly an increase in the price of the underlying security. Similarly with the red line that would indicate a decrease in price.

    Each row is marked in the Long/Short columns with a 1 to indicate the direction of change in MA5. 1 in LC column would indicate uptrend while 1 in SC column would indicate downtrend.

    [Move Probabilities and Average Magnitude] group will give you 3 scenarios, Win/Neutral/Loss, the probability of each happening and the corresponding statistical mean of the % move.

    The details are summarised in the last 2 columns [Directional % Change] that combine the information above in one single value that gives you both the direction (sign) and size (the value) of the MA5 change. Long and Short positions have separate columns.

    For example IBM in the second row, the potential change in MA5 5 days from now would be -2.835% - so a slight downtrend. If we read the detailed columns, there is a 47% chance of a 6% (-0.06) down move, 33% chance of a 2% down move (-0.02) and a 20% chance of a 3% (+0.03) up move.

    Hope this clarifies some of the questions, I have to admit that I should have explained it better. signals.jpg
     
  4. ddebrazza

    ddebrazza Active Member

    Joined:
    Jun 23, 2021
    Messages:
    472
    Likes Received:
    141
    Yes, thank you for explaining and providing the IBM example. I was able to follow what you are saying.

    Can you explain the last column a little bit for me the "directional change %" ; long win vs. short win

    Let's say I wanted to make purchases/ buys based on your algorithm and predictions... Which stocks represent the highest probability to increase in value based on this? I understand they will be updated each week, but for this upcoming week lets say
     
  5. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    "directional change %" is the combination of the detail columns and represents the statistically most likely outcome for the MA5 change for the underling security. Basically is a probability weighted move derived from the 3 set of Win/Neutral/Loss columns.

    I will update the list every trading day - at most 2 hours after the close.

    The 'directional change %' is sorted from short to long with the biggest short moves at the top and an biggest long moves at the bottom.

    I've highlighted them in the attached snips.

    Biggest "Short" moves ...
    short_sp500.png

    Biggest "Long" moves....
    long_sp500.png

    Cheers.
     
  6. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    To explain the reason behind [Move Probabilities and Average Magnitude] columns....

    probs.png

    No stock market prediction will ever be perfect, good predictions are very close to the Actual value more often than not and the Actual value will form a distribution around the Predicted [Signal]. Different levels of the Signal will have different distributions. For those who have heard about boxplots, here is my Predicted (or Signal) vs Actual that I use to calculate the Move Probability and the Magnitude.

    boxplot.png
     
    #6 mech.trader, Jul 5, 2021
    Last edited: Jul 5, 2021
  7. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    Attached are the MA5 % change prediction for the SP500 components as of 06 Jul 2021 EOF.
     

    Attached Files:

    anotherdevilsadvocate likes this.
  8. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    Attached are the MA5 % change prediction for the SP500 components as of 07 Jul 2021 EOF.
     

    Attached Files:

  9. mech.trader

    mech.trader New Member

    Joined:
    Jul 4, 2021
    Messages:
    7
    Likes Received:
    2
    SP500 trend - 8 Jul 2021 EOD update.
     

    Attached Files:

  10. ddebrazza

    ddebrazza Active Member

    Joined:
    Jun 23, 2021
    Messages:
    472
    Likes Received:
    141
    Can you give a "For Dummies," Version.

    Like "Based on My Algorithm, stocks: X and X and X and X will perform the best this week"

    I have limited time but am interested in learning more if I see that you are having a good rate of success....
     

Share This Page