Quantcast
Channel: System Trader Success
Viewing all articles
Browse latest Browse all 323

Introducing The Losing Streak Indicator

$
0
0

In a recent article written by Michael Harris on his blog, he compared the performance of the 2-period RSI indicator popularized by Larry Connors and Cesar Alvarez with a two-day losing streak indicator. The two-day losing streak indicator simply buys the market after two consecutive losing days. While the original article focused on comparing these two entry methods over the recent history of the S&P ETF market (SPY), I’m going to focus on a longer term study of this indicator within the future’s market (ES). Free EasyLanguage code will be provided at the conclusion of this article.

Mean Reversion

As a reminder, the traditional two-period RSI indicator (RSI(2)) is an indicator we have used many times on this website. So I will not spend much time talking about it within this article. Overall, it’s primarily used on the stock index markets such as the S&P, as a method to determine an entry point for a mean reverting trading models. You can read more about the RSI(2) indicator and the trading models built from it by reviewing these articles:

Two-Day Losing Streak Indicator

I’m going to use EasyLanguage in order to build a strategy to test the effectiveness of this indicator. Again, the indicator simply highlights when the market has two consecutive losing days. To build this simple indicator I’m going to assume that a losing day is defined when the market closes below its open. We sell our position when we have just the opposite condition, a two-day winning streak.

The trading rules provided in the original article are:

  • Buy at the open of next day if 2-Day Losing Streak
  • Sell at the open of next day if 2-Day Winning Streak

The EasyLanguage code for the basic strategy will look something like this:

Variables:
BuySignal(false),
SellSignal(false);
BuySignal = ( Close < Open ) And ( Close[1] < Close[1] );
SellSignal = ( Close > Open ) And ( Close[1] > Close[1] );
If ( BuySignal ) then Buy("LE") next bar at market;
If ( SellSignal ) then Sell("LX") next bar at market;

Testing Environment

Because you, the reader might want to build a trading model based upon this indicator, I’m going to break the historical data into two portions. An in-sample portion and out-of-sample portion. I will perform my testing for this article on the in-sample portion only. Thus, when I’m finished with my testing we’ll still have a good amount of data which can be used for out-of-sample testing.

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 $25,000
  • In-sample dates are from 1998 through December 31, 2012
  • One contract was traded per signal
  • $30 was deducted per round-trip for slippage and commissions

Baseline Results

Below is the baseline results over our in-sample historical segment. The maximum drawdown is a percentage of our starting equity, which is $25,000. Keep in mind that this study has no stops, thus some positions will hold through some very deep pullbacks before exiting. Again, we are testing the performance of an indicator at this point – not a trading model.

BaselineResults

Baseline_EQ_Curve

Longer Losing Streak

The first thing that I noticed in a two-day losing streak may not be deep enough. Two-day pullbacks are somewhat common. As pointed out in the original article, over the past few years a two-day pullback has been a great pattern. Market pullbacks have been shallow and these shallow pullbacks have been great entry points. But what about helping to ensure this indicator will work under different conditions?  Testing three or four days consecutive losing days may generate more profitable and/or tradable results. For past experience I know, in general, deeper pullbacks may provide a better profit vs risk. That is, the generated signals will be fewer in number but will also provide better rewards. So I modified the code and generated the following results based upon the number of days required in the losing streak before opening a new position. During this testing I did not modify the exit rules. They remained the same with two consecutive winning days acting as the exit trigger.

FourDayResult

As expected we see the number of trades decreases and the average profit per trade increases as we increase the number of losing days. Deeper pullbacks happen less often, but have larger payouts. The four-day losing streak has only 85 trades so I’m going to use the three-day losing streak during the remainder of my testing. This is a good compromise as a three-day pullback does appear to eliminate many shallow and unproductive pullbacks. Below is the equity graph for the three-day losing streak.

Baseline_3_Days_EQ_Curve

Bull/Bear Regime Filter

The next characteristic to explore is the difference between a bull and bear market. I’ll divide the market into two regimes based upon a 200-day simple moving average. The market will be “bullish” when price is trading above the 200-day SMA. The market will be “bearish” when price is below this moving average. Below is the results of the indicator in each of these regimes.

RegimeTest

Surprisingly, at least to me, we see better performance with the bear market. Overall, both the bull and bear regimes are profitable. The bear regime does suffer from larger drawdowns but it also has the biggest rewards. Notice that both regimes also have the same number of trades. I checked this a couple of times and it does appear to be correct. Given this result, I will not include a regime filter as we test our final modification I wish to test.

5-Day SMA Exit

The 5-Day SMA Exit closes a position once price closes above a 5-day simple moving average. This exit is often used with the RSI(2) system and it’s worth testing here as well. Below are the results of this test vs our baseline. As a reminder, the Baseline column represents the 3-day losing streak with a 2-day exit.

SMAExit

FiveDaySMAExit_EQ_Curve

 

The power of a good exit! By changing the exit to our 5-day simple moving average we have significantly improved the performance. All metrics have improved. Notice the significant reduction in drawdown. This is huge.

So how does this hold up against the 2-period RSI indicator? Let’s see…

RSI(2) vs Losing Streak

Below is the results of using a two-period RSI with a threshold of 10 vs our 3-day losing streak. Both methods exit when price crosses the 5-day SMA.

LosingStreakvsRSI

So which one is better? They are very similar in most of the metrics. The maximum drawdown is a lot higher with the RSI(2) system. Again, neither of these tests utilize a stop.

Overall, these are very interesting results as Michael Harris has demonstrated a simple price pattern that can be used as an effective replacement for a short-term indicator. I encourage you to perform your own testing to see if this simple price pattern indicator could be used in your own trading. Below you will find the EasyLanguage code for code used in this study.

Downloads

Losing Streak Strategy (text file)
Losing Streak Strategy (TradeStation ELD file)
Losing Streak WorkSpace (TradeStation WorkSpace file)

The post Introducing The Losing Streak Indicator appeared first on System Trader Success.


Viewing all articles
Browse latest Browse all 323

Latest Images

Trending Articles



Latest Images