August 15

7 comments

When To Go Long: S&P Intraday Price Study (Update for 2022)

By Jeff Swanson

August 15, 2022

Automated Trading Development, EasyLanguage, ES, market studies, S&P Emini

EasyLanguage can be a powerful tool for day traders who want to take advantage of intraday price fluctuations in the S&P 500. This article looks at a study that can help you determine when it might be advantageous to go long on the index.

The key to successful intraday trading is securing that elusive edge. System traders often look for price patterns that will give them an indication as to when to go long or short. In this article, I'll highlight the first step you want to perform before attempting to build your trading system. 

We're going to explore the S&P 500 intraday price data from 2000-2021 to find out what type of trading system and market conditions will be most favorable for the building of an intraday system. Read on as we reveal our findings!

Before building a trading system, we're going to perform an intraday price study. We're doing this to determine if we can find an edge. We want to answer a couple of questions before building a system. 

  • First, what trading style performs best (mean reversion or trend following)? 
  • Second, what market conditions work best (Bear Market or Bull Market)? 

I'm going to be using the S&P E-mini futures market, but the principles here could be applied to any market.

Our first step is to break a trading day into five market sessions. We do this to see if a particular session is more profitable than others.

Five Market Sessions

  1. Pre-Market, 06:30 to 08:30
  2. The Open, 08:30 to 10:30
  3. Midday, 10:30 to 12:30
  4. The Close, 12:30 to 15:00
  5. Post-Market, 15:00 to 19:00

Now that we have these various times defined, I want to create two simple trading strategies. Each system with represent a different trading style.

Trend Following and Mean Reversion

Generally, we can attempt to trade the market with either a trend-following strategy or a mean reverting strategy. Trend following implies the market is moving in a particular direction, and we expect it to continue.

On the other hand, a mean reverting strategy means we expect the market to reverse soon, and thus we position our trade opposite to the current market direction. To determine which type of trading strategy would work better during these periods, I’m going to create two simple trading strategies. One system will be a mean revering strategy, while the other will be a trend following strategy.

The trading systems should be straightforward. I’m not looking to create a trading system to trade per se, but I am attempting to locate clues as to what type of trading strategy (mean reversion or trend following) might work during a particular session. To keep this simple, I’m going to explore trades on the long side only and will be looking at the trading days between 1/1/2000 and 12/31/2021.

I will use a 10-period RSI for the mean reversion entry rule and enter a long position when the value is less than 25.

If ( RSI( Close, 10 ) < 25 ) Then
   
Buy("SE Mean") next bar at market;

For the trend following the entry rule, I will use the 10-period momentum calculation and open a long position if the momentum is below zero. 

If Momentum( Close, 10 ) > 0 Then 
   Buy("SE Momentum") next bar at market;

Market Regime Filter

The next question we want to answer is, what market conditions does our trading system perform best? I often will make use of a market regime filter when I’m developing a trading system. This filter breaks the market into two distinct regimes: bull and bear.

We will use a 200-period simple moving average on a daily chart to determine if we are in a bull or bear market. A bear market is when the price is below the 200-period moving average, and a bull market is when the price is above the moving average.

Using this filter will limit our long trades to only be taken when the price is trading above the 200-period moving average on a daily chart. In other words, we will take trades in the direction of the overall market trend.

  • Bull Market = price > 200-daily simple moving average.
  • Bear Market = price <= 200-daily simple moving average.

We're ready to start our study. 

Trending Following Testing

BULL MARKET: I will apply the trend-following strategy across the five sessions. I will only take long trades during a bull market when our momentum indicator is above zero. I will close each trade at the end of the period. 

Below is a table representing the average trade profit for each session. You can sort the table by Average Net Profit Per Trade by toggling the "triangle" on the column header.

Session Number

Session Description

Avg NP / Trade ($)

1

TF Bull: Pre-Market

1.60

2

TF Bull: The Open

-18.79

3

TF Bull: Mid Day

-.18

4

TF Bull: The Close

-12.31

5

TF Bull: Post-Market

24.69

The result shows that during a bull market, there is an edge with momentum trading during The Post-Market session. So, if you're looking for a long intraday strategy, you may want to focus on this session.

Winner: The Post-Market

BEAR MARKET: Let's switch things up a bit. Let's now only take long signals during a bear market. In other words, I will only take long trades during a bear market when our momentum indicator is above zero. This is the opposite of the test we just performed above, and it is also a counter to the prevailing major market trend.

Below is a table representing the average trade profit for each session. You can sort the table by Average Net Profit Per Trade by toggling the "triangle" on the column header.

Session Number

Session Description

Avg NP / Trade ($)

1

TF Bear: Pre-Market

-1.24

2

TF Bear: The Open

2.72

3

TF Bear: Mid Day

0.29

4

TF Bear: The Close

10.90

5

TF Bear: Post-Market

-.06

Taking long trend following trades in a bear market sure looks different! None of the options look good. The only exception is the close. It seems there might be a slight edge during the last minutes of the daily session—a rally into the close, which I've seen in other studies.

Winner: The Close

Mean  Reversion Testing

BULL MARKET: Now, I will test using our mean-reversion trading system rules over the five different periods. I will only take long trades during a bull market when our mean reversion indicator is below 25.

Below is a table representing the average trade profit for each session. You can sort the table by Average Net Profit Per Trade by toggling the "triangle" on the column header.

Session Number

Session Description

Avg NP / Trade ($)

1

MR Bull: Pre-Market

17.46

2

MR Bull: The Open

46.44

3

MR Bull: Mid Day

36,39

4

MR Bull: The Close

63.56

5

MR Bull: Post-Market

-85.48

Only The Close session holds any promise. The $63.56 per trade is a vast value covering two ticks of slippage and commission. If you're building a mean reversion strategy, check out The Close session during a bull market.

Winner: The Close

BEAR MARKET: I will now test using our mean-reversion trading system rules over the five periods during a bear market. In other words, I will only take long trades during a bear market when our mean reversion indicator is below 25. This is the opposite of the test we just performed above, and it is also a counter to the prevailing major market trend.

Below is a table representing the average trade profit for each session. You can sort the table by Average Net Profit Per Trade by toggling the "triangle" on the column header.

Session Number

Session Description

Avg NP / Trade ($)

1

MR Bear: Pre-Market

8.58

2

MR Bear: The Open

17.00

3

MR Bear: Mid Day

-2.78

4

MR Bear: The Close

7.77

5

MR Bear: Post-Market

-14.93

Here we see our best edge can be found at The Open during a bear market. However, it's not a very strong edge.

Winner: The Open 

The Final Results

I took all the results from above and put them into a single table, below. Now you can sort by Average Net Profit Per Trade by toggling the "triangle" on the column header. 

Session Number

Session Description

Avg NP / Trade ($)

1

TF Bull: Pre-Market

1.60

2

TF Bull: The Open

-18.79

3

TF Bull: Mid Day

-.18

4

TF Bull: The Close

-12.31

5

TF Bull: Post-Market

24.69

1

TF Bear: Pre-Market

-1.24

2

TF Bear: The Open

2.72

3

TF Bear: Mid Day

0.29

4

TF Bear: The Close

10.90

5

TF Bear: Post-Market

-.06

1

MR Bull: Pre-Market

17.46

2

MR Bull: The Open

46.44

3

MR Bull: Mid Day

36.39

4

MR Bull: The Close

63.56

5

MR Bull: Post-Market

-85.48

1

MR Bear: Pre-Market

8.56

2

MR Bear: The Open

17.00

3

MR Bear: Mid Day

-2.78

4

MR Bear: The Close

7.77

5

MR Bear: Post-Market

-14.93

By sorting the average net profit per trade from highest to lowest, we can see what bubbles up to the top. We can presume that these are the best opportunities for building an intraday long-only trading system.

The best performing sessions are:

  1. Mean Reversion : Bull: The Close
  2. Mean Reversion : Bull: The Open
  3. Mean Reversion : Bull: Mid Day

Interestingly, the closing session holds the most promise. Notice the top sessions are mean reverting strategies during bull markets. 

Below are the equity graphs of the top three performers. Click on each image for a larger view of the equity curve.

The Close

The Close

The Open

The Open

MId Day

Mid Day

Notice that the primary strength of the equity curve has occurred over the most recent data. This may demonstrate that these edges are new phenomena and will likely fade at some point in the future.

It's likely these types of edges change over the years. Thus, it may be essential to perform these studies a couple of times per year. It might even be worth using less historical data to focus on what's happening now—may be looking at the last two years of trades, for example. In short, you have to be more adaptable if you want to trade intraday.

Conclusions

What I did in this article is a relatively simple study, but such studies can often point you in the right direction when gathering ideas on trading systems. In short, we are asking, where might be the low-hanging fruit? 

Again, we performed a market study BEFORE building a trading system. We discovered that mean reversion seems to be a better choice. Think of how much time this might save you by not attempting to build a trend-following system! And that's the point. We use our EasyLanguage skills to explore the market characteristic and then try to create a trading strategy to fit those characteristics. Other traders attempt to force a trading style upon the market, often leading to wasted time and frustration.

This type of study can also be applied to any other instrument or timeframe. Likewise, we only explored long trades during this study, and adding a shorting study would also help build a complete picture. 

Other ideas could include using different indicators for our trend following and mean reversion trading systems. Likewise, it would also be essential to vary the look-back period for our indicators. By testing a range of values, say between 6-14, we can demonstrate the robustness of the look-back period.

Hope you found this helpful.

Jeff Swanson

About the author

Jeff has built and traded automated trading systems for the futures markets since 2008. He is the creator of the online courses System Development Master Class and Alpha Compass. Jeff is also the founder of EasyLanguage Mastery - a website and mission to empower the EasyLanguage trader with the proper knowledge and tools to become a profitable trader.

  • My thoughts exactly. Displaying it as one bar graph to cover so many years might not be meaningful. I’d like to see how consistent it is. Even though you aren’t trying to develop a system here, if the bulk of the profits came from one month to skew the whole sample then the bar graphs mean very little.

  • Jeff, I am a budding system developer.

    I have to say, without a doubt, that most of what I have learned is from your trading blog.

    1) you don’t over-complicate your systems. They are intuitive and easy to understand.

    2) An earlier analysis of how to look at each variable by itself, and see if there is smooth curve as the variable values change, was specially valuable. I am already using that in my analysis, and hope you actually develop an article around that exact subject.

    Thanks again,
    keep up the GREAT work.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Learn To Code & Build Strategies
    Using EasyLanguage. 

    >