Wednesday, May 24, 2023

Backtesting Strategies

The Emini S&P Future has printed 5 consecutive times a Down day on Tuesday.  Does it have statistical relevance?

Since 2000 following are results selling the next day:




Not very good......
Regardless the result what are considerations to make sure you are following a reasonable process to assess the relevance of your findings? Let's see how chatgpt answers to the question.

"Determining the statistical relevance of a pattern, such as five consecutive down Tuesdays in the stock market, requires a rigorous statistical analysis. It involves examining historical data, conducting hypothesis testing, and considering various factors such as sample size, significance levels, and the presence of confounding variables".

"It's important to note that isolated patterns or observations, without a solid statistical analysis, may not have significant predictive power. Stock market movements are influenced by a wide range of complex factors, including economic indicators, market sentiment, geopolitical events, and investor behavior. Therefore, relying solely on a short-term pattern like consecutive down Tuesdays may not provide reliable predictions or trading strategies".

"To determine the statistical relevance of a pattern like five consecutive down Tuesdays in the stock market, we need to conduct a hypothesis test. Here's a step-by-step approach:
- Formulate the null hypothesis (H0): The occurrence of 5 consecutive down
   Tuesdays in the stock market is due to random chance and has no predictive
    significance.
 - Collect historical data: Gather a dataset containing historical stock market returns
    for Tuesdays over a significant period. Ensure the data is reliable, consistent,
    and covers various market conditions.
- Define the statistical test: Select an appropriate statistical test based on the
   characteristics of the data. One potential test could be a binomial test or a runs
   test, depending on the specific nature of the data.
- Set the significance level (alpha): Determine the acceptable level of risk for
    rejecting the null hypothesis. Commonly used values are 0.05 or 0.01,
    representing a 5% or 1% chance of making a Type I error, respectively.
- Calculate the p-value: Perform the statistical test using the collected data and
   calculate the p-value. The p-value represents the probability of observing the
   pattern (or a more extreme one) assuming the null hypothesis is true.
 - Evaluate the results: Compare the calculated p-value with the significance level. If
   the p-value is smaller than the significance level, we reject the null hypothesis,
   indicating that the pattern is statistically significant. If the p-value is larger than the
   significance level, we fail to reject the null hypothesis, suggesting the pattern may
   be due to chance.
- Consider additional factors: It's crucial to consider the broader context and avoid
   overfitting. Assess whether other variables, such as economic indicators or
   seasonal effects, may be influencing the observed pattern".

Remember, statistical significance does not guarantee practical significance or future predictive power. Even if the pattern is statistically significant, it's essential to conduct further analysis, validate results using out-of-sample data, and consider the limitations and assumptions of the statistical test. These considerations make sense and actually the result provided by my test have no significance in my view mainly because they are based on a very limited number of observations, p-value and T-test are not good and I have not considered using out of sample data.


No comments:

Post a Comment

Yahoo Finance Futures Contracts Historical Data

Futures data downloaded from yahoo finance are not adjusted as continuous contracts. When you download futures data from Yahoo Finance or ma...