December 7


Capturing Profit With A Short Squeeze Strategy

By Jeff Swanson

December 7, 2020

I was recently wondering if I could capture some of the end-of-day moves that can happen in stock index markets. These are the strong moves that might occur during the last hour or so of the regular session. See the image below.

End of day rally

Example of an end of day rally to new highs.

So the basic idea would be to open a trade 1-2 hours before the close and exit the trade just before the market closes.

When would I open a new trade? Well, there are many ideas. You could open a trade if the current price is above/below today's open. Or you could open a trade if the current price is above/below yesterday's high.

Midpoint Function

I recently ran across TradeStation's midpoint function, which got me wondering if that would work as a decent starting point for this afternoon trading idea.

The midpoint function is the middle between today's highest high and lowest low. Put another way; it's the middle of today's range.

Below is an image of the midpoint indicator (white line) applied to a 5-minute chart of the @ES.D.

At 1300 Central, we decide to enter a trade or not. We go long/short if the current price was above/below the midpoint value. Then, close the trade at the end of the day.

In EasyLanguage, the code would look something like this:

Threshold = midpoint( Close, barCount );
if (Close > Threshold) and (Time >= 1300)  and (Time <= 1445) then
   Buy ( "Trend LE" ) next bar at market ;
if (Close < Threshold) and (Time >= 1300) and (Time <= 1445) then
   Sellshort ( "Trend SE" ) next bar at market;

Let's test it.

Trading Environment

I coded the above rules in EasyLanguage and tested it on the E-mini S&P (@ES.D) market going back to 2007. All the tests within this article are going to use the following assumptions:

  1. Starting account size of $25,000 
  2. Dates tested are from 2007 through November 30, 2020
  3. Trading 1 contract
  4. Max two trades per day
  5. $30 deducted for slippage and commissions per trade
  6. No stops

If we take long trades when above the midpoint and take trades below the midpoint, we get an ugly picture.

Are we finished? 

Not yet!

Bull/Bear Regime Filter

Once again, I will apply a 200-day simple moving average to my strategy and test the following ideas.

  1. Go long only during a bull market
  2. Go long only during a bear market
  3.  Go short only during a bull market
  4.  Go short only during a bear market

Which one of these test came out the winner?

No too surprisingly the results above are from taking long trades in a bear market. I say not too surprisingly because the E-mini S&P tends to have strong mean reverting characteristics and during a bear market, strong rallies into the close do happen.

Long Trades Only In Bear Market

It's clear that the short side is not productive. Let's look at only taking long trades.


The strategy in this article is far from a complete system. We can see the average net profit is about $58, which is too low in my opinion. Looking at the equity curve, we can see it's far from ideal as it has some significant drawdowns and stagnate regions. But we're moving in the right direction. Other filters may help reduce unproductive trades and boost our performance.

What else could we test? Well, what about selling short if the price is above the midpoint? Or, going long if the price is below the midpoint? How about testing the impact of volatility on the performance? Do other breadth indicators have a positive impact? How does is it perform on other markets?

It's these types of ideas that can lead to profitable trading systems so, get busy!

If you want to learn how to test ideas like this using EasyLanguage, look at my Builder Edition of System Development Master Class. It's all about learning EasyLanguage so you can turn your ideas into EasyLanguage and discover trading edges.

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.

  • Hey Jeff. This has me thinking about testing a few more ideas. Is the mid point indicator already built in to TS? Not finding it

    • Hi Dan. Yes, it’s a TradeStation function. It’s really simple. Here is the code for the “MidPoint” function by TradeStation.

      { Search Tag: WA-MidPoint }
      inputs: Price( numericseries ), Length( numericsimple ) ;

      MidPoint = ( Highest( Price, Length ) + Lowest( Price, Length ) ) * .5 ;

      { ** Copyright © TradeStation Technologies, Inc. All Rights Reserved **
      ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** }

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

    Learn To Code & Build Strategies
    Using EasyLanguage.