futures trading – Helping you Master EasyLanguage https://easylanguagemastery.com Helping you Master EasyLanguage Sun, 01 Feb 2026 10:53:17 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 https://easylanguagemastery.com/wp-content/uploads/2019/02/cropped-logo_size_icon_invert.jpg futures trading – Helping you Master EasyLanguage https://easylanguagemastery.com 32 32 When To Go Short: S&P Intraday Price Study (Update for 2022) https://easylanguagemastery.com/building-strategies/when-to-go-short-sp-intraday-price-study/?utm_source=rss&utm_medium=rss&utm_campaign=when-to-go-short-sp-intraday-price-study https://easylanguagemastery.com/building-strategies/when-to-go-short-sp-intraday-price-study/#respond Mon, 04 Jul 2022 10:00:56 +0000 http://systemtradersuccess.com/?p=4241

There are many opportunities to find a trading edge with intraday systems, and we will explore the very first step you should take.

This article will be an extension of a previous article where we performed an intraday price study. We do this by exploring different market sessions to determine if we can find an edge for a possible intraday trading system. If you have not read the previous article, When To Go Long, I urge you to read this because we will jump in and explore the same concept on the short side.

As a reminder, here are the five market sessions we will be looking at.

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

We will use the same trading principles used in the previous article. The only difference is we will be shorting the market instead of going long.

I will use a 10-period RSI for the mean reversion entry rule and enter a short position when the value is above 75.

If ( RSI( Close, 10 ) > 75 ) Then
   
Sellshort("SE Mean") next bar at market;

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

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

I will also use a simple 200-period moving average applied to the daily chart to act as a regime filter. A single trade is entered, and the position is closed at the end of the market session as defined above.

We are allowing only one trade per day. Slippage and commissions are not deducted, and no stops are used. I'll be testing using 15-minute data from 2000 - 2021. 

Trend Following Testing

BEAR MARKET: We're going to open a trend following trade when the momentum is below zero and when price is in a bear market. (daily price trading below the 200-day SMA).

Winner: Post-Market

Session

Avg NP / Trade ($)

TF Bear: Mid Day

12.26

TF Bear: Post-Market

17.42

TF Bear: Pre-Market

2.05

TF Bear: The Close

5.73

TF Bear: The Open

-15.38

BULL MARKET: I will reverse the regime filter, so we will take trades during a bull market. That is, we will be opening new trades when the price is trading above the 200-day simple moving average. I would not expect this to show great results. Shorting the stock index market during a bull market is very difficult.

Winner: Pre-Market is the clear winner. However, it's a meager value, and notice all the other sessions are negative. Shoring during a bull market is difficult!

Session

Avg NP / Trade ($)

TF Bull: Pre-Market

6.51

TF Bull: The Open

-2.55

TF Bull: Mid Day

-6.54

TF Bull: The Close

-12.13

TF Bull: Post-Market

-8.16

Testing Mean Reversion Characteristic

BEAR MARKET: Now, I will test our mean-reversion trading system rules over the five different periods. Trades are only opened during a bear market. 

Winner: Post-Market. The Pre-Market is the clear winner. Notice that most other sessions are positive, but only The Open is in the double digits.

Session

Avg NP / Trade ($)

MR Bear: Pre-Market

4.12

MR Bear:The Open

34.27

MR Bear: Mid Day

3.27

MR Bear: The Close

-37.13

MR Bear: Post-Market

65.69

BULL MARKET: Let’s now look at our mean-reversion trading strategy during a bull market. 

Winner: Pre-Market. Again, we can see shorting in a bull market is difficult.

Session

Avg NP / Trade ($)

MR Bull: Pre-Market

21.54

MR Bull: The Open

-8.10

MR Bull: Mid Day

-25.52

MR Bull: The Close

-19.15

MR Bull: Post-Market

3.08

Conclusions

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

Avg NP / Trade ($)

MR Bull: Pre-Market

21.54

MR Bull: The Open

-8.10

MR Bull: Mid Day

-25.52

MR Bull: The Close

-19.15

MR Bull: Post-Market

3.08

MR Bear: Pre-Market

4.12

MR Bear: The Open

34.27

MR Bear: Mid Day

3.27

MR Bear: The Close

-37.13

MR Bear: Post-Market

65.69

TF Bull: Pre-Market

6.51

TF Bull: The Open

-2.55

TF Bull: Mid Day

-6.54

TF Bull: The Close

-12.13

TF Bull: Post-Market

-8.16

TF Bear: Pre-Market

2.05

TF Bear: The Open

-15.38

TF Bear: Mid Day

12.26

TF Bear: The Close

5.73

TF Bear: Post Market

17.42

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 short only trading system.

The best performing sessions are.

  1. Mean Reversion: Bear: Post-Market
  2. Mean Reversion Bear: The Open
  3. Mean Reversion Bull: Pre-Market

Mean Reversion is the better strategy as all the top-performing strategies are mean reversion. Furthermore, shorting in a bear market takes the top two positions. The third position is interesting. It's shoring during a bull market.

Notice that shorting the Pre-Market during both a bull and bear market appears to hold an edge. Interesting.

Mean Reversion: Bear Market: Post-Market

Backtested Results: Here we can see the vast bulk of the profit happened on a handful of trades in 2022. So, I would not put too much value into trading this session. It looks like a few excellent trades biased the results. Of course, this good fortune may continue forward into 2022 and beyond.

Mean Reversion: Bear Market: The Open

Backtested Results: In this session we can see we have a climbing equity curve. This tells me we might have an an edge for a mean revering strategy during this session.

.

Mean Reversion: Bull Market: Pre-Market

Backtested Results: This is the best looking equity curve out of the three. This looks like the strongest session where a mean reversion strategy might be developed. Ironically, it's shorting during a bull market!

Conclusions

Remember, the strategies presented in this article are not viable trading systems as they currently stand. The strategies in this article are market studies! You can’t expect these simple trading strategies to produce results with real money.

These are nothing more than indicators to point us in the right direction. However, this article and the previous article demonstrate a way to analyze the market in an attempt to find an edge.

Can an intraday trading system be developed from the information presented in this article? Maybe. It will depend upon many factors. The point here is that this gives us a way to narrow our focus to a place to start.

Good luck, and let us all know, in the comments below, if you found this helpful or if you had success with building a trading system. 

]]>
https://easylanguagemastery.com/building-strategies/when-to-go-short-sp-intraday-price-study/feed/ 0
A Simple Trading System For Trading In A Bear Market https://easylanguagemastery.com/strategies/simple-shorting-strategy/?utm_source=rss&utm_medium=rss&utm_campaign=simple-shorting-strategy https://easylanguagemastery.com/strategies/simple-shorting-strategy/#comments Mon, 23 May 2022 10:00:10 +0000 http://systemtradersuccess.com/?p=4307

The major stock index markets are below their 200-day moving average. That's bearish!

A bear market can be a trader's worst nightmare. Prices are falling, volatility is high, and everyone seems to be selling. How can you make money in this type of market? One approach is to short counter-trend rallies in the stock index futures markets. Does such a system exist?

We'll review a simple shorting strategy in this article and see if we. Can take advantage of the downtrend and potentially make some profits. So, how does it work? Let's take a look.

Over the years, I've looked at several straightforward long strategies published in the book "Short Term Trading Strategies That Work" by Larry Connors and Cesar Alvarez. Those articles include the following long strategies:

Buried within Connors and Alvarez’s book, you will find one simple shorting strategy used on the major market indices. I will review this strategy in this article and see if we can improve it.

A Simple Shorting Strategy

The rules of this system are very simple.

  • Price must be below its 200 day moving average.
  • If the instrument closes up for four or more days in a row, sell short at close.
  • Cover your position when price closes below a 5-day SMA at open of next bar.

The trading model is straightforward and attempts to fade strong bullish moves when the market sentiment is bearish. By only taking trades when the market is below its 200-day SMA, we ensure bears are in control. We then attempt to sell into short-term bullish strength as defined by four days of consecutive market advances.Below is a screenshot showing example trades on the E-mini S&P. Click the image for a larger view.

Simple Shorting Strategy Trade Examples

Simple Shorting Strategy Trade Examples

Unless otherwise stated, all the tests performed in this article will be based on the following assumptions:

  • Starting account size of  $100,000.
  • Dates tested are from 2000 through May 12, 2022
  • There are no deductions for commissions and slippage.
  • There are no stops.
Simple Shorting Strategy Equity Curve

Simple Shorting Strategy Equity Curve

Simple Shorting Strategy Annual Returns

Simple Shorting Strategy Annual Returns

Not very impressive, with only 26 trades since the year 2000 we only generate 3.51% return on our capital. But this is expected as shorting is very difficult for the stock index markets.

The stock market indexes have an upside bias (trading above the 200-day SMA), so this strategy does not have the opportunity to open many trades. Thus as the strategy stands today, we're not capturing enough profit to make it worth pursuing. This is a similar result I wrote about in this article, “The Death Cross – What You Need To Know.

While I don’t expect much change, I loaded this strategy on the major futures index markets (NQ, YM, RTY). Below are are the results.

Simple Shorting Strategy

ES

NQ

YM

RTY

Total Net Profit

$12,950

-$2,465

$14,260

$18,460

Profit Factor

2.80

.81

2.34

6.13

Total No Of Trades

26

22

31

31

NP/DD

2.1

.11

2.9

2.7

Avg.Trade Net Profit

$487.08

-$112.05

$460.00

$595.48

Max Drawdown (intraday)

$6,225

$21,700

$4,995

$6,830

The clear winner is the RTY market. It has a wonderful looking equity curve, pictured below, but of course, it still suffers form lack of trades.

Simple Shorting Strategy Equity Curve RTY

Simple Shorting Strategy Equity Curve RTY

Generating More Trades

The main problem with this strategy is the lack of trades. Can we generate more trades? I think so.

The original rule to open a new position is to look for 4 consecutive up days. So, we're looking for a counter-trend rally but, why four days? Why not three days or five days? Let's make this entry rule a bit more dynamic.

Larry Connors is well known for popularizing the 2-period RSI. The well-known rule to go long the stock index market when the 2-period RSI goes below 20 is a solid buy signal during a bull market. Let's reverse this idea for a bear market.

We will make an important change. Because bear markets tend to be much more volatile, I'm going to double the RSI look back from two to four. I think a 2-period look back will fire off too frequently. In bull markets, we can have strong countertrend rallies and we don't want to short too soon into those rallies.  

So, our sell short rules will now look like this:

  • Price must be below its 200 day moving average.
  • The 4-period RSI must be above 75.

Let's look at the two best candidates from the original rules (ES and RTY) after applying this new entry rule.

ES With RSI(4)

We can see we did generate more trades. We've gone from 26 to 44. Sill not great, but an improvment.

Simple Shorting Strategy Equity Curve ES RSI

Simple Shorting Strategy Equity Curve ES RSI Entry

RTY With RSI(4)

Yes, we've added more trades here as well. We've gone from 31 to 50. We've lost our beautiful-looking equity curve, but we have more trades, and we're still making new equity highs going into 2022.

Simple Shorting Strategy Equity Curve RTY RSI

Simple Shorting Strategy Equity Curve RTY RSI Entry

Simple Shorting Strategy With RSI(4) Entry

ES

RTY

Total Net Profit

$31,850

$19,500

Profit Factor

3.59

2.36

Total No Of Trades

44

50

NP/DD

3.5

3.1

Avg.Trade Net Profit

723.86

$390.00

Max Drawdown (intraday)

$9,225

$6,2903

Conclusion

Can we make money shorting the market? Yes, but the results are not overly impressive with this strategy. It's great we found a simple technique to increase the number of trades, but it might be best to sidestep that bear market and find other opportunities elsewhere. 

You might be wondering, is this system tradable with real money? Not yet! I think this has potential but remember, there are no stops. With a bit of work on your part, you could trade something very similar to what's presented here.

]]>
https://easylanguagemastery.com/strategies/simple-shorting-strategy/feed/ 11
The One Thing Before Building A Intraday Trading System https://easylanguagemastery.com/building-strategies/step-one-in-building-an-intraday-trading-system/?utm_source=rss&utm_medium=rss&utm_campaign=step-one-in-building-an-intraday-trading-system https://easylanguagemastery.com/building-strategies/step-one-in-building-an-intraday-trading-system/#comments Mon, 13 Jul 2020 10:00:19 +0000 http://systemtradersuccess.com/?p=3658

If you have been reading EasyLanguage Mastery for a while you’re probably familiar with how I develop trading systems. The very first step is to come up with a simple idea to act as the seed or core of your trading system. I call this your Key Idea. This key idea is a simple observation of market behavior. This observation does not need to be complex at all. In fact, they are often very simple.

For example, here is a key idea: most opening gaps on the S&P market close if the gaps are less than 4 points. This key idea is very simple, and testable. It is from such observation that I’ll often start to build a trading system from.

In this article I want to show you a tool I use to help test key ideas on an intraday chart. Building trading systems on intraday charts (day-trading systems) are some of the more difficult systems to develop when compared to daily charts. First, you must deal with more market noise but even more dangerous are slippage and commissions. Why? Your potential profit per trade is small on a day trading system thus, both commissions and slippage take a bigger bite out of your profits (as a percentage of your P&L). This produce drag on the performance of your system much like a strong headwind slows your advance. In short, it’s more difficult!

The Key Idea

For this example let’s create a simple trend following strategy for the Euro currency futures (EC) market on a 5-minute chart. We’ll use the extreme readings on the RSI indicator as our signal. Because we are using RSI as a trend indicator that means we are looking to enter the market when RSI gives us an extreme reading. That is, go-long at the oversold region and go-short at the lower region.

  • Buy when nine period RSI value above 80
  • Sell Short when nine period RSI value below 20

This might be a little different than how most people would use RSI. Most of the time, it seems anyway, you would fade the extremes. However, when it comes to the markets unconventional can be beneficial. As for the extreme values, those are un-optimized numbers. I just picked them off the top of my head in hopes of looking for a strong swing in either direction. Also, I picked a value of nine for the RSI look-back period because I wanted it to be more sensitive than the default 14 that is often used. (The value of nine really has no significance. It was not optimized and I could have very well picked 7 or 10. I just simply picked it.)

Below is the EasyLanguage code for the key idea.

MyRSI = RSI( Close, RSILookBack );

If ( MyRSI < ShortZone ) Then
begin
   GoShort = true;
   GoLong = false;
End

Else If ( MyRSI > BuyZone ) Then
Begin
   GoShort = false;
   GoLong = true;
End;

If ( MP = 0 ) Then
Begin
   If ( GoShort and BullTrend ) Then Sellshort ("RSI Short") next bar market
   Else If ( GoLong and BearTrend ) Then Buy("RSI Buy") next bar at market;
End;

If you code this basic concept up and test it from 08:30 to 15:00 (central) on the EC market what do you think you’ll get? That’s right, a losing concept with an ugly equity curve.

Clearly, we don’t want to trade our system at any time during the U.S. day session. We want to focus when EC is most likely to show strong trending characteristics. If the price of EC is strong enough to push the RSI value above 80 we want the price to continue climbing. So, what market session is best suited for this RSI trend system? Or are all market sessions hopeless for this simple trading concept? Let’s find out.

The Session Test

When designing a day trading system one of the first steps I want to perform is to test which market session will likely produce the best results. We are all aware that different sessions exist for any given market. For example, when dealing with the S&P E-mini we have a pre-market session - the morning session, lunch time session, and an afternoon session. Sometimes you can see distinct characteristics within each session.

So, when I’m developing a trading system for day trading I don’t want to blindly trade during every session. I want to be more targeted in my approach. There will be most likely a particular session or two where my key idea will do better than the other sessions. In order to test our key idea vs. different sessions I need to create an EasyLanguage function that can isolate these sessions and execute the key idea individually over those sessions only.

This is where my “Session Testing” code comes into play. Session Testing is an EasyLanguage function that I wrote to help me in this task of testing various intraday sessions. Using TradeStation’s optimizer I can test my idea across different combinations of sessions and discover how the key idea holds up across each session. Here are the basic sessions:

  1. “Pre-Market” Between 05:30 and 08:30
  2. “Open” Between 08:30 and 9:00
  3. "Morning" Between 9:00 and 11:30
  4. “Lunch” Between 11:30 and 13:15
  5. “Afternoon” Between 13:15 and 14:30
  6. “Close” Between 14:30 and 15:15
  7. “Post-Market” Between 15:00 and 18:00
  8. “Night” Between 18:00 and 05:30

From this list of basic sessions I created several more “sessions” based upon combinations of the above.

  1. “Pre-Market” + “Open”
  2. “Pre-Market” + “Open” + “Morning”
  3. “Open” + “Morning”
  4. “Open” + “Morning” + “Lunch”
  5. “Lunch” + “Afternoon”
  6. “Lunch” + “Afternoon” + “Close”
  7. “Daily Session”
  8. “Night” + “Pre-Market”
  9. “Morning” + “Afternoon”

The 17 different sessions I came up with may not please everyone. Perhaps you have a contrasting idea on how to break up the different sessions and with the code provided you can simply change them to your liking. For example, if you are interested in the European markets and trade those times, you can create your own sessions based around the European markets.

Session Test Function

The session testing function is really simple. You place it within your strategy and pass into the function the session number you wish to test. Below is an example of testing session 1 – what I’m calling pre-market.

TradeFlag = SessionTest( 1 );

The variable TradeFlag will be set to a Boolean value based upon if the current time is pre-market (true) or not (false). Now we can use TradeFlag as a switch to enable/disable our trading as demonstrated below.

If ( TradeFlag ) Then
Begin
// Trade Logic goes Here
End;

What’s going on inside of the function? It’s rather simple as it’s nothing more than a bunch of if-then statements testing the current time. Below is a code, snip-it to give you an idea of what it looks like.

If ( SessionToTest = 1 ) And ( Time >= PREMARKET ) And ( Time < THE_OPEN ) Then TradeFlag = true

Else If ( SessionToTest = 2 ) And ( Time >= THE_OPEN ) And ( Time < MORNING ) Then TradeFlag = true

If ( SessionToTest = 3 ) And ( Time >= MORNING ) And ( Time < LUNCH ) Then TradeFlag = true

Else If ( SessionToTest = 4 ) And ( Time >= LUNCH ) And ( Time < AFTERNOON ) Then TradeFlag = true

Here is our code with the session test function applied.

If ( TradeFlag ) Then
Begin

   MyRSI = RSI( Close, RSILookBack );

   If ( MyRSI < ShortZone ) Then
   begin
      GoShort = true;
      GoLong = false;
   End
   Else If ( MyRSI > BuyZone ) Then
   Begin
      GoShort = false;
      GoLong = true;
   End;

   If ( MP = 0 ) Then
   Begin
      If ( GoShort and BullTrend ) Then Sellshort ("RSI Short") next bar market
      Else If ( GoLong and BearTrend ) Then Buy("RSI Buy") next bar at market;
   End;

End;

Testing All Sessions

Next let’s see what happens when I run TradeStation’s optimizer over each of the sessions. In doing so TradeStation will systematically execute my key idea strategy over each market session and record the trading results. This can be done by simply creating an input value to act as the session number to test. Then you simply optimize over the values 1-17.

After all the sessions have been analyzed I can generate a bar graph representing the P&L for each session. Below is the Net Profit graph which depicts the total net profit from our testing. By the way, we were testing this strategy from January 1, 2003 to December 31, 2011. This time-span covers both bull and bear markets. It’s important to test your key idea over a wide range of market conditions. Slippage and commissions are not factors into these results.

In this case we can see session input value number 12 produces the best net profit. This input value is actually a combination of Open, Morning, and Lunch sessions. It’s during these times EC market apparently demonstrates strong trending characteristics that we might be able to take advantage of with our key idea.

Let’s now isolate the session input value to 12 and execute our key idea on this specific time. For this test I will deduct $18.50 per round trip for slippage and commissions. Below is the equity graph of our key idea along with some performance numbers.

There is no optimization here. The code simply trades based off un-optimized RSI signals and the results look promising. Below is the Trade Summary Report.

Please note I have no stops or targets within my test strategy. Instead the strategy simply enters a trade if the proper condition is met and the trade is exited only at the close of the session. That’s it. Remember, I’m not testing a trading strategy. I’m testing a key idea vs. different market sessions. My goal is to locate the best possible market sessions for my key idea. In this case, which session holds the strongest trending characteristic? Once a session(s) has been identified only then will I continue to develop a complete strategy (containing stops, targets, and other rules) tailored to the top session(s).

Conclusion

There you have it. This type of RSI trend following concept should be developed for the Open, Morning, and Lunch sessions. This makes sense. The big volume and big trends often appear during the U.S. day session. This is also corroborated from a previous Best Times To Day Trade, where I explored the hourly range of the Euro Currency market. In that study we can see that the hours between 08:00 and 11:00 (Central) have the highest price movement of the EC market.

I would like to point out again, this is not a trading system. What we did in this article was to validate our key idea. The code presented in this article does not have stops, a regime filter, volatility filters, profit targets, or any number of other checks and balances we might see in a true trading system. In fact, take a look at the average profit per trade. It’s $15 after slippage and commissions which is too low in my opinion. I would like to see this closer to $50 per trade or higher.

]]>
https://easylanguagemastery.com/building-strategies/step-one-in-building-an-intraday-trading-system/feed/ 12
Two Dimensional Market Environment Filter https://easylanguagemastery.com/building-strategies/two-dimensional-market-environment-filter/?utm_source=rss&utm_medium=rss&utm_campaign=two-dimensional-market-environment-filter https://easylanguagemastery.com/building-strategies/two-dimensional-market-environment-filter/#comments Tue, 25 Dec 2018 11:00:51 +0000 http://systemtradersuccess.com/?p=2567

In this article I’m going to demonstrate a technique to help adapt your trading systems to the changing market conditions. In a previous article entitled, “Trend Testing Indicators“, I tested several indicators that could be used to divide the market into two modes: bullish and bearish. These two modes were then used to dictate how the trading system should execute its trades. For example, during a bull mode only open long trades. During a bear mode only open short trades. In essence, we made our system adapt to the given market conditions. However, we can take this concept further by looking at a different market characteristic: trend strength.

A market may be in a bull regime, but how strong is the trend? Is the market rising fast or is it range bound? We would like to know if the market is trending strong or not because we would like to trade them differently. It’s clear a range bound market that should be traded differently than a trending market. In general you may want to hold an open position longer if the trend is strong. By measuring the strength of the trend we can further divide the market to make our trading system more adaptive. By introducing trend strength we now create four distinct market environments that can be used to determine how an automated system trades.

Four Market Environments

Bull Market

Bear Market

Weak Trend

1

2

Strong Trend

3

4

In this article I’m going to create  a simple strategy that will focus on the market environments one and three. That is, we will look at a weak-trending bull market and a strong-trending bull market.

Trading Environment

Our strategy will be coded in EasyLanguage and tested on the SPY ETF going back to 1993. All the tests within this article are going to use the following assumptions:

  •  Starting account size of  $50,000.
  •  Dates tested are from 2006 through December 31, 2019
  •  1 Contract per trade
  •  The P&L is not accumulated to the starting equity.
  •  There are no deductions for commissions and slippage.
  • No Stops

The Baseline System

For the buy and sell signal I’m going to use the very familiar 2-period RSI Strategy from the book, ”Short Term Trading Strategies That Work”, by Larry Connors and Cesar Alvarez. The system only goes long. There is no shorting. This strategy goes long in the S&P 500 E-mini when the market experiences a pullback in a long-term uptrend. Based on our previous article, “Trend Testing Indicators“, we determined the smoothed ROC indicator which may be an effective market regime filter. So we will use a 200-period ROC calculation to determine if we are within a bull market. The 2-period RSI is used to locate pullbacks (entry points) within our bull market. An RSI value below a 10 will tell our system to open a new long position. We exit the trade when the 2-period RSI rises above 65 . The rules are:

  • 200-Period ROC calculation must be above zero.
  • Buy on close when RSI(2) is below 10.
  • Exit when RSI(2) is above 65.

This system is applied to a daily bar chart going back to 2006.

Looking at the trading rules, you can see that the Baseline System has a market mode filter (the 200-day smoothed ROC) to identify the overall bullishness or bearishness of the market. But we make no distinction between a strong trending bull market and weak trending bull market. If we are in a strong bullish market it makes sense to hold on to our trade in an attempt to capture a bigger move. On the other hand, if we are not in a strong trending market we may want to exit our long position rather quickly. Yet, our Baseline System always sells when a 2-period RSI rises above 65. The exit makes no adjustment for the trendiness of the market.

Introducing Trend Strength

Let’s use Trend Strength Indicator to gauge the trend strength of the market. Trend Strength Indicator (TSI) can be found over at Engineering Returns (no longer around). You can also download the code at the bottom of this article. Let’s also define a strong trend as >= 1.65 and a weak trend as < 1.65. These are not optimized numbers. They are simply a generalization from experience.

Now, let’s modify our exit parameter to hold longer during a strong trend. We’ll exit when a 2-period RSI rises above 95. This should allow us to hold our position longer and capture more profit during a strong trend.

The TSI indicator is provided as a download within the TradeStation ELD and within the Text File found within the download section at the conclusion of the article.

Our new bull market exit rules look like …

  • If TSI >= 1.65 Exit when RSI(2) of the close of current day is above 95

Below is a snapshot of several trades where the market trend changes from non-trending to trending. You can see that during a trending market we are holding the trade longer simply by requiring the RSI(2) value to rise above 95. The trades on the left half of the image are non-trending trades (LE_nt) while the two trades on the right half of the image are trending trades (LE_t).

Let's also change our entry rules based upon the trend strength. If we are experiencing a strong trend we want to make our entry rules a bit looser. That is, we expect pullbacks to be shallower when a market in trending strongly. So, we'll make our 2-period RSI threshold 25 instead of 10. This will allow us to enter shallower pullbacks during a strong trending market.

Now let’s take a look at the performance of this strategy.

1S VS 2D Filter

1D Filter

2D Filter

Net Profit

$10,575

$32,513

Profit Factor

1.19

1.60

Total Trades

111

88

%Winners

74%

72%

Avg.Trade Net Profit

$95

$369

Consective Losers

3

3

Annual Rate of Return

1.45%

3.79%

Net Profit / Drawdown

0.59

1.66

By introducing a simple trend strength indicator and making our strategy adapt to the trend strength, we generate more net profit and more profit per trade. We do decrease the number of trades as well. This is a good improvement and it demonstrates that we are on the right track by holding our position longer during a strong trend.

What if we simple hold all our traders (strong trend or not ) with our strong trend exit method?

1D Filter

2D Filter

Always 

Net Profit

$10,575

$32,513

Enter your text here...

Profit Factor

1.19

1.60

Cell

Total Trades

111

88

Cell

%Winners

74%

72%

Cell

Avg.Trade Net Profit

$95

$369

Cell

Consective Losers

3

3

Cell

Annual Rate of Return

1.45%

3.79%

Cell

Net Profit / Drawdown

0.59

1.66

Cell

Conclusion

There you have it. A strategy that adapts to several different market conditions. I did not cover the bear market regime, but you’re certainly free to explore that. Likewise, you can expand this concept to create a strategy that more drastically changes its trading behavior based on which of the four market environments we defined. Maybe during a strongly trending bull market you will want to use a completely different exit method than used during a non-trending market. In closing, this should provide some idea on how you can use two different types of indicators to divide the market into four different market environments.

]]>
https://easylanguagemastery.com/building-strategies/two-dimensional-market-environment-filter/feed/ 16
Improving The Double Seven Strategy https://easylanguagemastery.com/strategies/improving-the-double-seven-strategy/?utm_source=rss&utm_medium=rss&utm_campaign=improving-the-double-seven-strategy https://easylanguagemastery.com/strategies/improving-the-double-seven-strategy/#comments Mon, 11 Jun 2018 10:00:17 +0000 http://systemtradersuccess.com/?p=6339

In this article I want to take a look at a reader’s recommendation on improving the Double Sevenstrategy. If you recall, the Double Seven strategy is a long-only strategy for the the broad U.S. indexes. It was created by Larry Connors and was covered in a previous article, “Double Seven Strategy”. Recently a reader pointed out a possible improvement to the system which appeared in the “Letters to the Editor” section of Stocks & Commodities Magazine, V. 27:3 (8-9). In short, the recommendation modified the entry and exit signals in an attempt to capture more profit. Changes included the following:  Market entry would become a buy stop entry and the exit would become a trailing stop. To be honest, I found the description of the changes not 100% clear and my testing was not promising. However, the concept of a buy stop and trailing stop are worth looking into. First, let’s provide a quick review of the Double Seven strategy.

The Original Rules

As a reminder, here are the original rules for taking long trades which are executed on a daily chart:

  • The instrument must be above its 200 day moving average
  • If the instrument closes at a seven-day low then buy at market
  • If a long position is open and the instrument closes at a seven-day high then sell at market 

Testing Environment

I coded the above rules in EasyLanguage and tested it on the S&P cash market going back to 1983. Before getting into the details of the results let me say this: all the tests within this article are going to use the following assumptions:

  • Starting account size of $100,000.
  • Dates tested are from 1983 through June 30, 2014.
  • The number of shares traded will be based on volatility estimation and risking no more than $2,000 per trade.
  • Volatility is estimated with a five times 10-day ATR calculation. This is done to normalize the amount of risk per trade.
  • The P&L is not accumulated to the starting equity.
  • There are no deductions for commissions and slippage.
  • There are no stops. Please note we are not adding our profits to our trading account! We are always trading a small percentage of our starting capital. Thus, the results demonstrated here are very conservative and it would be easy to generate much higher returns. Here is the position sizing formula used:

Shares = $2,000 per trade / 5 * ATR(10) For an example of what the trades will look like on a daily chart, below is an image of a couple of trades. As the market makes a seven-day low, a long trade is entered. Open trades are then closed at the next seven-day high.

Double Seven Results

 Based upon the standard rules we get the following results trading the S&P cash market.

Double Seven Strategy

Double 7...

Net Profit

$60,959

Profit Factor

2.68

Total Trades

159

%Winners

80%

Avg. Trade Net Profit

$383

Annual Rate of Return

2.48%

Consecutive Winners

15

Consecutive Losers

3

Max Drawdown (Intraday)

$7,417

Equity Curve line

Modification of Entry Signal

The recommendation within Stocks & Commodities Magazine recommended…

“Set a sell-stop 0.1 below the close of the seven-day high, and keep moving it below the close each day until you are sold out.” I modified this a bit. In essence, we have a classic trailing stop and it makes a lot of sense given we are attempting to capture as much profit as possible when the market recovers from a pull-back in an overall bullish regime. Presumably during a strong market we can expect price to occasionally go beyond our traditional seven-day high exit. A trailing stop may very well capture more profit. Of course some of the trades will “give back” some of the profit as price must fall to hit our seven-day stop, but the handful of runners should provide us with more P&L to offset these setbacks. The only way to really see if this will work is to test it. For my test I used the seven-day low instead of the close.  Below are the results with our new modified seven-day low trailing exit.

Improving Double Seven Strategy

Double 7

Trailing Stop

Net Profit

$60,959

$71,727

Profit Factor

2.68

2.22

Total Traders

159

257

%Winners

80%

36%

Avg.Trade Net Profit

$383

$279

Annual Rate of Return

2.48%

2.82%

Consecutive Winners

15

5

Consecutive Losers

3

7

Max Drawdown(Intraday)

$7,417

$8,206

We can see we make slightly more net profit but it comes at a price. Our profit factor falls as does the percentage of winning trades. We decrease our consecutive winners while increasing the number of consecutive losing trades. We do have a slightly larger average profit per trade, but we obtain this with less efficiency as seen by our profit factor. Viewing the equity curve you can clearly see the choppiness of this system. Sure it makes more money, but it’s not a clean looking equity curve when compared to our standard Double Seven Strategy. Why would this be? By introducing our trailing stop we are causing a number of trades to get stopped out that ultimately turn in our favor. This leads to more trades when compared to the original rules as well. Recall the original rules have no hard stop – only dynamic exit at a new seven-day high. By adding our trailing stop we immediately place a hard stop at the low of the past seven-days. Introducing this stop ‘hurts’ our system. Can we try something else? Maybe what we can try is only introducing the trailing stop when… 1. a new seven-day occurs; and 2. we have positive P&L. This will delay adding the trailing stop.

Price will be free to meander or make new lows instead of taking us out at a nearby stop level. If price happens to move lower before we add our trailing stop then makes a new seven-day high and our open position P&L is negative, we’ll call this a losing trade and simply exit at the market. However, if we have positive open position P&L at a seven-day high, we’ll activate our tailing stop. Below are the results.

Improving Double Seven Strategy

Double 7

Trailing Stop

Trail on Positive P&L

Net Profit

$60,959

$71,727

$89,649

Total Traders

2.68

2.22

2.96

Profit Factor

159

257

206

%Winners

80%

36%

43%

Avg.Trade Net Profit

$383

$279

$435

Annual Rate of Return

2.48%

2.82%

3.33%

Consecutive Winners

15

5

5

Consecutive Losers

3

7

6

Max Drawdown(Intraday)

$7,417

$8,206

$11,320

This looks a lot better. We are making significantly more profit and doing it will decent efficiency based upon the profit factor value. We do take some significant heat based upon the drawdown value. Overall, the equity curve looks decent as we make more profit per trade.

Modification of Entry Signal

The recommendation within Stocks & Commodities Magazine recommended…

“Set a buy-stop 0.1 above the close of the seven-day low, and keep moving the buy-stop down above each day’s close until you are bought in.” The idea is we can often enter at a lower price if the market continues to fall dramatically over the next day. I tested this with not much promise. To me, setting a buy-stop at a level .01 above the close of the bar does not make a lot of sense. Often when setting a buy stop to enter the market you set it above a recent significant high. What comes to mind is the daily high. So, that’s what I did next. When the market markets a new seven-day low, I then place a buy-stop at the high of the bar. Price must then hit that high in order for a new position to be opened, confirming some strength on the bullish side. Please note, we are adding these new entry rules but keeping our original exit. This is because I want to see how these new rules changes the system without the interference of our new exit
This significantly reduced profitability. Clearly, buying into the weakness is better than waiting for bullish confirmation. While it may “feel better” to wait for bullish confirmation before opening a long trade, the performance metrics clearly state you should be buying into weakness. In short, the original rules produce much better results.

Conclusion

This experiment was not really a test based upon the rules provided by the Stocks & Commodities Magazine reader. However, it was inspired by it. Thus, it’s possible the reader’s solution may be better than what I’ve come up with here. I really don’t know. However, I think we can see some basic tenants of trading the S&P during a bull market that many readers of this website will be familiar with.

1. Buy into weakness with a market order.

2. Hold a trade to gain more profit.

These are well known tenants of the S&P and this strategy test just highlighted them once again. Other things that could be tested include buying with limit orders and exiting into strength based upon a different indicator such as a 2-period RSI. In closing, we found that our best results were realized by only modifying our exit rule to include a trailing stop.

]]>
https://easylanguagemastery.com/strategies/improving-the-double-seven-strategy/feed/ 20
The Double Seven Strategy https://easylanguagemastery.com/strategies/double-seven-strategy/?utm_source=rss&utm_medium=rss&utm_campaign=double-seven-strategy https://easylanguagemastery.com/strategies/double-seven-strategy/#comments Mon, 10 Oct 2016 10:00:07 +0000 http://systemtradersuccess.com/?p=4165

It’s time to look at another simple trading system which can be found in the book, ”Short Term Trading Strategies That Work” by Larry Connors and Cesar Alvarez. In this article we are going to look at the Double 7 strategy. This is a simple strategy that can be applied to the major market indices such as DIA, DOW and QQQ. It can also be applied to the futures markets.

The rules of this system are very simple.

  • The instrument must be above its 200 day moving average.
  • If the instrument closes at a 7-day low – buy.
  • If a long position is open and the instrument closes at a 7-day high – sell.

The trading system follows two basic concepts we have talked a lot about on this website. Namely when trading the major market indices, like the S&P, an effective strategy is to buy pullbacks in a major up trend. This system does just that. The major up-trend is defined by price being above the 200-day moving average. A pull-back is defined as a close below the lowest-low over the past seven days. Once a trade is entered, we simply look for a new seven day high to exit. Super simple. Below is an example of some trades on the S&P Cash Index. Click the image for a larger view.

Looking at the trading rules, you will also notice it’s a long-only system. Later in this article I will also reverse the rules and test it on the short-side. But for now, let’s look at the performance for the long-only system. At this point I’m going to test it on the S&P cash index ($SPX.X for TradeStation).

Unless otherwise stated, all the tests performed in this article will be based on the following assumptions:

  • Starting account size of  $100,000.
  • The number of shares traded will be based on volatility estimation and risking no more than $2,000 per trade.
  • Volatility is estimated with a five times 20-day ATR calculation. This is done to normalize the amount of risk per trade.
  • The P&L is not accumulated to the starting equity.
  • There are no deductions for commissions and slippage.
  • There are no stops.

Here is the position sizing formula used:

Shares = $2,000 per trade / 5 * ATR(20) * Big_Point_Value ) 

This looks very promising. Keep in mind, the system has no stops.

Is The 7-Day Optimized?

Let’s look at changing the 7-day look-back period for two reasons. First, I would like to see if the default seven value is optimized. Secondly, I would like to know if other nearby values are used, would the system remain viable. In short, I would like to test the robustness of  the look-back period. For example, if we change the 7-day low value to six, I don’t want to see the system’s equity curve drastically change. Likewise, if we increase the 7-day low value to eight, I don’t want to see a drastic change in results. The neighboring values around seven should still produce positive results. In fact, it would be great to see the system  remain profitable over a wide range of values.

I will use TradeStation’s optimization feature to optimize the look-back period over the values 2-20 in increments of one. Keep in mind this single input value controls two look-back periods. The first is the entry look-back and the second is the exit look-back. As the trading system is defined, both these variables use the same value.  The results of the test are in the graph below. You can click the image to see a larger view.  The x-axis contains the look-back period while the y-axis contains the trading systems total P&L.

This looks great. Any value you choose produces positive results. Each change in the look-back period also does not drastically change from neighboring values. The default value of seven is near the peek, which is six, but it’s not the most optimal number. It’s also important to keep in mind we will be using the default value of seven for other instruments as well and it’s highly unlikely the bar graph for those instruments would look exactly like what we have here. In any event, I think this brings a lot of confidence to the look-back period.

Is The Regime Look-Back Optimized?

Just as we did for the look-back period for our entry trigger, let’s perform the same type of test on the regime look-back period. Again, I will use TradeStation’s optimization feature to optimize the look-back period over the values 20-200 in increments of ten. The results are in the graph below. You can click the image to see a larger view.  The x-axis contains the look-back period while the y-axis contains the trading systems total return.

This looks great as well. All values produce positive returns. In general, the longer the look-back period the more profit the system generates. While I did not study the numbers just beyond 200, I feel confident that a 200-period look-back is not optimized.

Taken both these tests we can feel confident that this system does not appear to be optimized and it’s robust given a wide variety of input values.

Going Short

The original system is a long-only system. Let’s try to use the current rules to short the market. We can do this by simply reversing the rules. In other words, we will modify the regime filter to only open trades when price is below the 200-day moving average. Trades will then open when price makes a new 7-day high and close when they make a new 7-day low.

  • The instrument must be below its 200 day moving average.
  • If the instrument closes at a 7-day high – sell short.
  • If a position is open and the instrument closes at a 7-day low – buy to cover.

I created a separate trading system to study only the short-side. The results of the system can be seen in the equity graph below.

This is not so great. Most of the time the equity curve is below the zero line. It’s choppy and ugly.  Clearly the market participants’ psychology during a bear market is different than simply a mirror image of those found in a bull market. One would think shorting new highs in a bear is a good idea, and maybe it is, but this system is not successful at capturing profit. Taking a wild guess simply from past experience, I have found that exiting quickly during bear markets tends to work better than in bull markets. Thus, maybe a modification of the exit rules to only hold a trade until the first profitable day or only hold for a maximum of three days may produce significantly better results. However, such modifications are best left for another day.

To further test our shorting idea, let’s now look at testing a range of look-back periods just like we did during our bull market. If our shorting concept is truly flawed, I would expect to see not much improvement in modification of our look-back period. In fact, since my wild guess is we need to exit quickly to remain profitable, I would expect to see greater losses as we continue to increase our look-back period. Likewise, I would expect to see greater profit as we shorten our look-back period. I will optimize the look-back period over the values 2-20 in increments of one. The results are in the graph below. You can click the image to see a larger view.

Just as I expected. In general the shorter the look-back period, the more profitable. However, since this is our first look at the Double Seven Strategy, I don’t want to over complicate it by introducing a shorting component. We’ll keep it simple for now and apply our long-only strategy to several major market ETFs.

Double Seven Strategy

Confident the long-only trading rules are robust and appear to hold potential, let’s now test this system on several major ETFs. Let’s test, SPY, QQQ, DIA, and IWM. For this test we are going to use all the same trading assumptions and position sizing as we did above except for the following modifications.

  • $100,000 starting account
  • Risk 2% of account equity per trade
  • P&L is not reinvested

Double Seven System

SPX

DIA

QQQ

IWM

Total Net Profit

$46,958

$22,188

$30,726

$35,731

Profit Factor

2.22

1.53

2.00

2.34

Total No Of Trades

159

135

135

126

% Profitable

70%

69%

73%

75%

Avg.Trade Net Profit

$295.33

$164.35

$227.60

$283.58

Return on Capital

46.96%

22.19%

30.73%

35.73%

Annual Rate of Return

2.00%

1.20%

1.60%

1.98%

Conclusion

The Double Seven Strategy does produce positive results across the four major market ETFs we tested. Is this system tradable with real money as is? Probably not. Remember, there are no stops. However, this does appear to be a great start to a viable system. I would imagine if some of the larger losing trades could be eliminated by some type of stop method, this system could be viable with real money.

 Get The Book

]]>
https://easylanguagemastery.com/strategies/double-seven-strategy/feed/ 4
The Death Cross – What You Need To Know https://easylanguagemastery.com/building-strategies/the-death-cross/?utm_source=rss&utm_medium=rss&utm_campaign=the-death-cross https://easylanguagemastery.com/building-strategies/the-death-cross/#respond Mon, 07 Sep 2015 10:00:00 +0000 http://eminiedges.com/wp/?p=957

On August 31, 2015 an indicator called “Death Cross” appears on the S&P cash index. This has not happened since 2011. The Death Cross is simply when a 50-period simple moving average (SMA) crosses under a 200-period SMA on a daily chart. Such a signal is believed to warn of upcoming bearish market activity. The opposite signal is called a “Golden Cross”, and is alleged to warn of bullish market activity. But does the Death Cross or the Golden Cross hold any merit? What can we learn from these signals and how can we use this information in our trading? In this article I’m going to demonstrate why the Death Cross is important and why its opposite signal, the Golden Cross, may be even more important.

Both the 50-period SMA and the 200-period SMA are well known moving averages. Thus a lot of eyes are watching price around these levels. It’s no surprise when these moving averages cross the event and might be worth noting.  One way to test how well the Death Cross and Golden Cross perform historically  is to create a simple trading system based upon these signals. Using TradeStation’s EasyLanguage coding language it’s simple to create a trading system that is always in the market switching between a long position and a short position based upon a moving average crossover. Here is what the entire trading system code looks like:

if ( Average(Close,50) crosses above Average(Close,200) ) then buy(“Golden Cross”) next bar at open;
if ( Average(Close,50) crosses under Average(Close,200) ) then Sell short(“Death Cross”) next bar at open;

Below is the most recent Death Cross. You can see the faster moving average (black) has dipped below the slower moving average (red).

Testing Environment

Before getting into the details of the results, let me say this: all the tests within this article are going to use the following assumptions:

  • Amount dedicated to each trade $100,000
  • Long only
  • The P&L is not accumulated
  • $30 was deducted per round-trip for commissions

In order to get a long-term feel for this system I’m going to use the S&P500 cash index going back to 1961. The trading system will trade a fixed dollar amount to each trade. In this case, $100,000.

Before we start looking at some of the numbers I want to break this study into two parts: Shorting a Death Cross vs. going long the Golden Cross. What interests me is how well the system functions going long vs going short. In other words, what does the SMA cross tell us about a bearish cross vs a bullish cross? Are they different?

Shorting The Death Cross

Since we recently experienced a Death Cross, let’s first look at shorting every Death Cross signal. The equity graph is below and it’s not pretty.

What does this tell us? To simply short the Death Cross may not be very profitable. We can see the equity curve hangs around the zero line for decades. In recent times it has climbed from negative territory to just below the zero line. Yet, there is nothing in this picture that suggests we have an edge simply shorting the S&P index upon a Death Cross signal. Below is a graph of the week drawdown experienced while shorting the Death Cross.

This is an ugly picture where you have many trades where drawdowns reached 30% or more. At some points you have to endure drawdowns of up to 65%. That’s massive heat you must take and what is your reward? Not to make any money! Simply using the Death Cross and Golden Cross as a timing signal does not appear to be a good use of your time.

Going Long The Death Cross

Maybe we should be taking the Death Cross as a buying opportunity? Why not? We want to be opposite the crowd, right? Below is the equity graph when we go-long at every Death Cross and exiting our trade when the Golden Cross appears.

Interesting! At times going long actually makes money and notice how the equity graph spends a lot of its time above the zero line. Furthermore, unlike shorting the Death Cross, going long actually produces a positive result. Not much of a result but the equity graph does end in positive territory. Counter intuitive to common knowledge, I would say. Yet, it’s not much of a profit for all those years of trading and it’s certainly not an edge we can take advantage of. All in all this strategy is a wash much like shorting the Death Cross. This graph probably reflects the fact that the S&P 500 has had a bullish bias since 1961.

The equity graph also shows that during those periods imminently after a Death Cross and before a Golden Cross we have continued market weakness. In other words, not many market gains take place when the 50-period SMA is below the 200-day SMA. In general, this appears to be a time of market weakness.

Let’s take a quick look at the drawdown one would have to endure with this type of strategy.

Not as bad as shorting, but there are two spikes of 50%. There is also plenty of time spent around the 20% drawdown mark. That’s still some ugly drawdown that would be very painful to endure.

Going Long The Golden Cross

Next let’s look at going long the Golden Cross and Exiting on on the Death Cross.  Below is the equity graph.

This is a much improved equity graph! We seem to have a clear edge going long the S&P cash index when a Golden Cross is triggered. This graph highlights the fact that when the 50-period SMA is above the 200-day SMA the market often exhibits strong bullish behavior. Below is the drawdown experienced by this system.

Here drawdown is limited to a maximum of around 12%. This is a massive improvement from our previous signals we looked at. A 12% drawdown is much more tolerable. Clearly when a Golden Cross shows up it appears to be the “all-clear” sign in terms of both reward and risk. That is, we see substation market gains and low drawdown.

Summary

Combining what we have now learned I would say it might be wise moving your investing accounts into cash when a Death Cross takes place. This would be done in my opinion to prevent drawdown and thus avoid the pain seeing your profits evaporate. After a Death Cross drawdowns over 50% can take place and we see the upside is limited. It’s certainly can be much more psychologically appealing to be in cash when those big bear markets hit. Shorting a Death Cross does not have much of an edge and you often see massive drawdown with little profit as well.  It’s only after a Golden Cross does the market hold a strong bullish edge.

The table below shows the performance of each system.

Short Death Cross

Long Death Cross

Long Golden Cross

Total Net Profit

-$19,742

$18,122

$442,921

Profit Factor

0.86

1.14

18.52

Total  Trades

27

27

28

% winners

30%

70%

82%

Avg.Trade Net Profit

-$741

$671

$15,818

Annual Rate of Return

-0.33%

0.30%

3.08%

Max Drawdown (intraday)

76%

62%

11%

Avg Time in Market

220 days

220 days

500 days

By comparing the market behavior during a Death Cross vs a Golden Cross we can come to some generalizations that might help in both your investing accounts as well as your trading accounts (depending upon your timeframe). Of course the results of this article are based upon the S&P cash index, not individual ETFs or stocks. Thus the results could be generalized for a broad U.S. tradable index like SPY. Of course, you must do your own testing!

Death Cross = Move To Cash: During this time the market shows general weakness to the upside. This weakness can be difficult to short and drawdowns can be very substantial.  Moving into cash during this time may prevent you from experiencing these significant drawdowns. Remember, we are not talking about day trading in this article. The Death Cross and Golden Cross are based upon slow moving averages that work best for long term holding periods. A skilled day trader can make a lot of money shorting during a bear market, of course. However, when it comes to using a slow timing method such as the Death Cross, it does not seem to pay off.

Golden Cross = Invest: Upon a Golden Cross signal the market has demonstrated a lot of bullish activity with low drawdown. It appears to be the “all clear” signal to enter the market once again. When a Golden Cross occurs, we should be looking to go long.

]]>
https://easylanguagemastery.com/building-strategies/the-death-cross/feed/ 0
Improving The Simple Gap Strategy Part 4 https://easylanguagemastery.com/strategies/improving-the-simple-gap-strategy-part-4/?utm_source=rss&utm_medium=rss&utm_campaign=improving-the-simple-gap-strategy-part-4 https://easylanguagemastery.com/strategies/improving-the-simple-gap-strategy-part-4/#comments Mon, 27 Jul 2015 10:00:41 +0000 http://systemtradersuccess.com/?p=7941

In the last article of this series, Improving The Simple Gap Strategy Part 3, I tested a price-based filter on the in-sample data. This filter was based upon the price action of the previous trading day. During this test we discovered that if the previous trading day was a down-day we could open a Simple Gap trade today. On the other hand, if the previous trading day was an up-day we should not take our Simple Gap trade today.

In this article I’m going to test dynamic stops and targets. Currently the strategy uses a fixed dollar amount for both the profit target and stop loss. I’m going to use the size of the gap as a factor in determining both the profit target and stop loss.

Testing Environment

Because I’m currently testing and developing this trading model I’m going to use my in-sample portion only. Before getting into the details of the results, let me say this: all the tests within this article will use the following assumptions:

  • Starting account size of $100,000
  • In-sample dates are from 1998 through December 31, 2012
  • One contract was traded per signal
  • The P&L is not accumulated
  • $20 was deducted per round-trip for slippage and commissions

Testing A Dynamic Profit Target

First, I’m going to test a dynamic target based upon the size of the gap. Before getting started I will revert back to our baseline which in this case is our Simple Gap strategy without the filters we have been testing in previous articles. At this stage of my testing I don’t like to combine different filters. I much prefer to measure the individual impact each filter has on the system.

The next thing I will do is comment out our hard stop. Why? Once again I want to measure the effect of our static profit target vs our new dynamic profit target. This means commenting out the hard stop in our baseline as well. With the stops disabled we will be directly measuring the static profit target vs our dynamic profit target without other variables interfering. Again, this technique is simply a way to isolate a key variable we are attempting to quantify. In this case, our stop loss method.

Now that I’m back to my baseline code, I’m going to create a new input value called prftTgFactor which will hold our profit target factor. This will be used to multiply with the gap size. A value of 1 for the prftTgFactor means we have a profit target equal to the size of the gap. A prftTgFactor of .5 means we have a profit target 1/2 the gap size.

With this new input I’ll use TradeStation’s optimization feature to test a range of targetFactors. I’m going to test a range between .1 and 2.0. This will generate 20 different tests.

In the above bar graph we can see all combinations produced negative return as each bar is below zero (left axis). This tells me a dynamic profit target, without a stop, is not enough to make this system break even. Restricting losses appears to be a critical component to push the strategy into profitability. Notice how there is a valley that’s right around the 1.0 value on the x-axis. This produces the “best” results and represents a profit target equal to the gap size.

Below is the equity graph of the baseline system with the profit target ($200) and stop loss removed.

Looking at the baseline results we see it makes profit. Again the baseline has no stop. Since the baseline makes a profit, we know a static profit target is responsible for the gains.  There seems to be something to the idea of taking a $200 profit and calling it a day as opposed to taking a profit based upon the gap size – at least given the study we have performed here.

This is not to say a dynamic profit target may not work with some gap strategies. Far from it. This is just telling us there is more going on here than meets the eye, and a dynamic profit target applied equally to all gap sizes does not appear to be a quick fix to profits. Yet, we still have more testing to do.

Testing A Dynamic Stop Loss

For the next test I’ll comment out our profit target for both the baseline and the new dynamic stop strategy I’m working on. Why? Once again I want to measure the effect of our static stop loss vs our new dynamic stop loss. To do this, I’m going to create a new input value called StopFactor which will hold our stop loss factor. This will be used to multiply with the gap size. A value of 1 for the StopFactor means we have a stop loss equal to the size of the gap. A StopFactor of .5 will mean we have a stop loss 1/2 the gap size.

With this new input I’ll use TradeStation’s optimization feature to test a range of targetFactors. I’m going to test a range between .1 and 2.0. This will generate 20 different tests.

There appears to be very little change when modifying the stop loss based upon the gap size. This is different than our profit target optimization test above where we can clearly see an optimal range. Here, not so much. All the values tested produced negative returns. This hints to me that given our current strategy, a dynamic stop may not offer much value.

For reference, below is the equity graph of the baseline system with the static stop only, no profit target.

Once again the baseline with the static stop loss makes a profit.  So what does this mean? Maybe profit targets will have more of an impact than a stop. Maybe having a static stop and a dynamic target would be a more powerful combination. However, it really appears that neither a dynamic profit target or a dynamic stop based upon the gap size will provide much of an improvement with our baseline system. We’ll test that next.

Combining Both Dynamic Stop and Target

After studying both the dynamic profit target and stop loss individually, I decided to combine them. I created two input values. The first was prftTgFactor. The second was StopFactor. I then used TradeStation’s optimization feature to optimize these two parameters together. After letting the optimization run there was no worthwhile profitable combination. The vast majority of the tests produced negative results. There was no stable range, there was no improvement. Far from it, in fact!

Conclusion

In the end it appears using a dynamic stop and/or a dynamic profit target based upon the size of the gap does not improve performance given the Simple Gap strategy. While dynamic stops and targets may work with other gap strategies, this particular strategy does much better with static values for both the stop loss and profit target.

In the next article of this series I’m tempted to combine our successful filters and see what we get.

Other Article In This Series

]]>
https://easylanguagemastery.com/strategies/improving-the-simple-gap-strategy-part-4/feed/ 2
Connors 2-Period RSI Update For 2013 https://easylanguagemastery.com/connors-rsi-update-for-2013/?utm_source=rss&utm_medium=rss&utm_campaign=connors-rsi-update-for-2013 https://easylanguagemastery.com/connors-rsi-update-for-2013/#comments Mon, 26 Aug 2013 10:00:00 +0000 http://systemtradersuccess.com/?p=4499

It’s been about a year since I’ve taken a look at the very popular 2-period RSI trading method by Larry Connors and Cesar Alvarez. We all know there are no magic indicators but there is an indicator that certainly acted like magic over several decades. What indicator is it? Our reliable RSI indicator.

Over the past few years the standard 2-period trading system as defined in the book, “Short Term Trading Strategies That Work”, has been in a drawdown. During 2011 the market experienced a sudden and sustained drop which put the system into loss. It has been slowly recovering since. Below is an equity graph depicting the trading system’s equity curve trading the SPX index from 1983. You can easily see the large drop around trade number 120.

Here is a closeup view of the last 19 trades, which covers about the last five years.

2-Period RSI System

Cannor's Rules

Total Net Profit

$28,742

Profit Factor

2.97

Total No Of Trades

129

% Profitable

82%

Avg.Trade Net Profit

$222.81

Return on Capital

28.74%

Annual Rate of Return

0.86%

The trading rules from Larry Connors are very simple and consist of long-only trades. As a reminder, the rules are as follows:

  • Price must be above its 200-day moving average.
  • Buy on close when cumulative RSI(2) is below 5.
  • Exit when price closes above the 5-day moving average.

All the tests within this article are going to use the following assumptions:

  • Starting Equity: $100,000.
  • Risk Per Trade: $2,000.
  • Number of shares is normalized based on a 10-day ATR calculation.
  • There are no stops.
  • The P&L of each trade is not reinvested.

Is the 2-period RSI indicator losing its edge? Hard to say at this time. It’s not like drawdowns have not happened before, but that’s not really what I want to explore. I want to take a closer look at the 2-period RSI indicator and see if we can improve the basic trading system by Larry Connors.

Days After Opening A Trade

First let’s take a look at how the market behaves after a RSI setup occurs. In short, the 2-period RSI is designed to highlight strong pullbacks. Buying into pullbacks in an uptrend has been a well known and effective trading method and is the essence of the 2-period RSI trading system. We can demonstrate this by looking at how the market behaves after a trade is triggered. I created an EasyLanguage strategy that can hold a position X days after opening a trade. I then tested X for values in the range from 1 through 30. In other words, I want to see how the market behaves 1-30 days after opening a trade. Does the market have a tendency to climb after trade setup occurs or does it tend to drift lower? Below is a bar graph which represents the results. Each bar is the total P&L based upon the number of holding days.

In general the longer the holding period, the more P&L is generated. This shows that after our 2-period RSI indicator triggers a trade, the market tends to climb over the next 30 days. It’s also important to notice all values produce positive results. This shows robustness in this particular parameter.

Moving Average Exit Period

The original trading rules by Larry Connors used a dynamic exit based upon a 5-day moving average. Once price closed above this average, the trade was closed. I wanted to take a closer look at the period used for this moving average exit. Like the bar graph above, I tested values 1-30 for the period used in the moving average.

In this graph we can see increasing profit as we increase the moving average period from one to 14. There is a slow decline after 14 as we continue to our final value of 30. It’s very good to see that all values produce positive results. This shows stability across this parameter and exit method.

RSI Threshold

Let’s look at the threshold value used to determine if the market has pulled back enough to trigger a long trade. Once again, we will create a bar graph as we look at a range of threshold values from 1-30.

We see values below 10 produce the best results. Once again, every value produces positive results and this is a very good sign.

Based upon the information we looked at in this article, let’s modify Connors’ trading rules. We will make the following changes:

  • Use a value of 10 as the RSI threshold.
  • Use a 10-period simple moving average as our exit signal.

Below is a table showing the difference between the original Connors’ rules and the modified Connors’ rules.

2-Period RSI System

Cannor's Rules

Modified Rules

Total Net Profit

$28,742

$62,800

Profit Factor

2.97

2.74

Total No Of Trades

129

227

% Profitable

82%

83%

Avg.Trade Net Profit

$222.81

$276.65

Return on Capital

28.74%

62.00%

Annual Rate of Return

0.86%

1.67%

Our increase in net profit comes at the cost of more trades which is due to the fact of lowering the stand on what we consider a viable pullback. By increasing the RSI threshold from 5 to 10 more setups qualify as a valid entry, thus we take more trades. But we also make more money on each trade. This is due to our longer hold period by increasing our moving average period from 5 to 10. In the end, we are willing to take more trades and hold on to those trades for longer periods of time.

Adding Stop Loss

All the results above do not use a stop loss value. Let’s add a $2,000 stop loss on each trade and see how it will change the results. I picked this value because it represents our risk value when scaling the number of shares to trade. Notice we are only risking 2% of our $100,000 account on each trade. The far right column holds the results with the $2,000 hard stop.


2-Period RSI System

Cannor's Rules

Modified Rules

Modified Rules W/Stops

Total Net Profit

$28,742

$62,800

$66,679

Profit Factor

2.97

2.74

2.93

Total No Of Trades

129

227

232

% Profitable

82%

83%

84%

Avg.Trade Net Profit

$222.81

$276.65

$287.41

Return on Capital

28.74%

62.00%

66.68%

Annual Rate of Return

0.86%

1.67%

1.75%

This just gets better and better. Often stops will hurt a trading system in several key performance factors but not here. Our $2,000 hard stop improves the system across several performance factors. Unlike the original trading system, this equity curve is producing new highs.

Across Different Markets

Let’s now look at the performance across different markets. I will not modify the trading rules at all.

IYY

IWM

DIA

QQQ

SPY

ES

Total Net Profit

$15,075

$16,864

$18,582

$14,714

$39,857

$35,863

Profit Factor

2.09

2.24

2.13

1.98

3.12

2.05

Total No Of Trades

74

83

92

86

293.07

95

% Profitable

81%

77%

74%

71%

87%

76%

Avg.Trade Net Profit

$203.73

$203.18

$201.97

$171.09

$293.07

$377.50

Return on Capital

15.08%

16.86%

18.58%

14.71%

39.86%

35.86%

Annual Rate of Return

1.18%

1.31%

1.19%

1.04%

1.74%

2.08%

Notice the number of trades is significantly lower for the above ETFs when compared with SPY. This is due to SPY being around since 1993 while these other ETFs are much newer. Overall, the system holds up nicely across these different markets.

Conclusion

The RSI indicator still appears to be a robust indicator at locating high probability entry points within the major market indices. You can modify the trigger threshold and holding period over a large range of values and still produce positive trading results. I hope this article will give you lots of ideas to explore on your own. Another idea in regards to testing parameters is to independently optimize the parameters over the “portfolio” of market ETFs instead of using just $SPX. There is no doubt in my mind the RSI indicator can be used as a basis for a profitable trading system.

Get The Book

Update:

This topic has been updated with performance through 2014.

]]>
https://easylanguagemastery.com/connors-rsi-update-for-2013/feed/ 89
Bulkowski’s Position Sizing https://easylanguagemastery.com/building-strategies/bulkowskis-position-sizing/?utm_source=rss&utm_medium=rss&utm_campaign=bulkowskis-position-sizing https://easylanguagemastery.com/building-strategies/bulkowskis-position-sizing/#comments Mon, 03 Dec 2012 11:00:16 +0000 http://systemtradersuccess.com/?p=2716 Position Sizing Background

For most of my investing career, I used a fixed dollar amount for money management when buying stocks. At the beginning, it was $2,000. That bought me 100 shares of a $20 stock. I thought that’s the method that everyone used. As I learned about the stock market, I knew that there were better ways to position sizing (money management) but I didn’t know what they were.

In the August 2007 issue of Active Trader magazine, Volker Knapp (see Trading system lab: “Percent volatility money management”) tested a system that used volatility to determine the position size. I already use volatility to determine stop placement (see Stop Placement), so this was a welcome addition. The article was based on Van K. Tharp’s book Trade Your Way to Financial Freedom.

 

Percent Risk Position Sizing

The first method, percent risk position sizing, is well known and it’s based on risk to determine the position size. For example, if you are looking to buy a stock with a price of $20 and a stop loss of $19, with a maximum loss of $2,000, you should buy 2,000 shares.

The formula for this approach is:

DollarRiskSize/(BuyPrice – StopPrice)

In this example, the DollarRiskSize is $2,000, the BuyPrice is $20 and the StopPrice is 19 giving a result of $2,000/($20 – $19) or 2,000 shares.

 

Percent Volatility Position Sizing

The percent volatility position sizing method adjusts the risk according to the stock’s volatility. Tests described in the article say it performs much better than the percent risk method.

Here’s the formula.

PositionSize = (CE * %PE) / SV

Where CE is the current account equity (size of portfolio)

%PE is the percentage of portfolio equity to risk per trade.

SV is the stock’s volatility (10-day EMA of the true range).

For example, if the current account equity (CE) is $100,000, the percent of portfolio equity we want to risk (%PE) is 2%, and the stock’s volatility is $1.25, then the result is: ($100,000 * 2%) / $1.25 or 1,600 shares.

Instead of calculating the 10-day exponential moving average of the true range, I just calculate the volatility using Patternz, which provides it at the click of a button.

The downfall of these two methods is that if your portfolio is $100,000, then the trade just described would chew up 1,600 shares x $20 buy price or $32,000. Thus, you can buy just over 3 stocks, giving you a concentrated portfolio. The percent-risk method would be even worse with $40,000 used for just one stock. (Of course this assumes that the stocks share the same buy price, volatility, and so on).

One way to avoid the concentrated portfolio problem is to divide the $100,000 into $10,000 allotments (or whatever size you feel comfortable with that would lead to a diversified portfolio), one for each stock. Use the same formula to determine the share size. In the percent volatility example, the computation would be: ($10,000 x 2%) / 1.25 or 160 shares.

I don’t know what this does to the profitability of the method because the article’s author didn’t discuss this. In any case, this page is about position sizing and not portfolio theory.

 

Position Sizing Excel Spreadsheet Template

I have an Excel spreadsheet template which does the math for both techniques. To use the spreadsheet, first download it and then fill in the yellow cells with the appropriate information. The position size appears in the blue cells. The following shows what the template looks like. Click the image to make it larger.

 

Bear Market Position Sizing

When a bear market begins, I cut my position size to limit losses. Recently, I decided to derive a mechanism to achieve that. The following table shows the rules for this new method to limit losses in a bear market.

By definition, a bear market begins when an index (I use the S&P 500) drops 20% below a peak. When that occurs, cut the amount allocated to each trade by half. If my position size is $20,000, I will cut it to $10,000.

If the market drops another ten-percentage points, then cut the position size in half again — from $10,000 to $5,000 in my case. Continue cutting the position size by half until it reaches $2,500 (or whatever value you choose).

The advantage of this position-sizing algorithm is obvious. As the bear market begins and worsens, your have the potential to lose less and less of your trading capital. However, this method does keep you in the market, so you can shop for bargains among a variety of stocks. That promotes diversity, which is also a good thing.

If there is a drawback, it’s that at a bear market bottom, you are investing few dollars in the market. When the bull market resumes, that’s when you want to pile back in. Of course, it’s often difficult to determine when a bear market ends and a bull market begins, so prematurely ramping up the position size can lead to larger losses.
dom.

 

Portfolio Position Sizing

How do you size the positions in your portfolio, assuming you wish to make multiple buys per stock (or just once)?

To get the position size (shown in the above table as $20,000 then $10,000), take the value of the trading account and divide it by the number of positions you want to hold. The number of positions you choose is up to you. Many will say to hold no more than 10 to 12 with at least 7 to 8 positions to give adequate diversity. As I write this, I own 22 positions with an eye to 30. Think of this as my own private mutual fund. I’m a skilled investor/trader with 30+ years of experience, so owning this many is not a problem…but that’s just me.

For example, say you have a portfolio currently valued at $300,000, and want to hold 30 positions, then each position would be $10,000. Within 20% of a bull market peak, you’d start with 10k per position. When the bear market begins, you’d cut that in half, to 5k and then 2.5k as the bear market worsens.

That gives you the amount to invest in each stock. Now, let’s adjust the position for volatility. The more volatile the stock the fewer shares you should own.
dom.

 

 Shares Per Trade

I saw one algorithm that compared the current stock’s volatility with its historical range. The “current” period used a 10-day high-low calculation but they didn’t specify what was meant by “historical.” In their example, they said “a few years ago” (whatever that means).

That bothered me. A company could have had a drug failure, dropping the stock by 70% in one session (huge historical volatility) and then sold the division. You might not know that unless you read the press releases or discovered it some other way.

I have a better idea. Why not compare the stock’s volatility to the market’s? Here’s the formula.

 Shares = (PositionSize * (MarketVolatility / StockVolatility)) / StockPrice

PositionSize comes from the above table, so it’s adjusted for the market conditions.

MarketVolatility is the daily change of the market over the last month, averaged, expressed as a percentage.

StockVolatility is the daily change of the stock over the last month, averaged, expressed as a percentage.

For the two volatility calculations, I calculate the high-low difference of the stock or market index (I use the S&P 500 index) each day for 22 trading days (about a month), average it, and divide it by the most recent close. This is nearly the same calculation that I use for a volatility stop, so check that link for an example. You can use the ATR, but it’s not as effective.

This will give you the number of shares to invest per position. You can have multiple positions per stock.

In short, take the ratio of the two volatilities to further adjust the bucks you spend and divide that by the current share price to get the number of shares.
dom.

 

Volatility Stop

We adjusted the amount spent per trade for the market conditions, and then we adjusted the number of shares for the stock’s volatility. The third leg of the algorithm is to use a volatility stop. That calculates a stop loss order based on a stock’s volatility in a manner similar to the above volatility calculation.

Thus, you have three pieces: Adjusting the position size for the market conditions, adjusting it for the stock’s volatility versus the market’s, and using a volatility stop to limit losses.
dom.

 

Position Sizing Example

Let’s assume we want to buy Gap (GPS) stock. It closed Friday, December 17, at 21.19. Our portfolio has a current value of $100,000 and we want to hold 10 stocks in the portfolio.

The S&P index is down less than 20% from it’s high a few days ago (it’s down less than 1% from the high). Thus, we’d spend the full $10,000 for this trade (that’s $100,000 / 10 stocks = $10,000). To find the number of shares, the market volatility is 0.009 (0.9%) and the stock’s volatility is 0.0213 (2.1%) — I have a program that calculates the two volatilities automatically. Plugging this into the formula, we get,

Shares = ($10,000 * (0.009 / 0.0213)) / 21.19 or 200 shares (I round up to the nearest 100 shares). They would be worth 200 * 21.19 or $4,238.

The volatility stop would be placed at 20.15, or 5% below the current close.

That gives us plenty of dollars to spend on the stock sometime in the future, to increase the position. The volatility and portfolio value will have changed by then, so you’d run another calculation to get the next investment amount.

— Tom Bulkowski

Copyright (c) 2011 by Thomas Bulkowski. All rights reserved. Reprinted with permission.

]]>
https://easylanguagemastery.com/building-strategies/bulkowskis-position-sizing/feed/ 1