Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Jeff65

RSI Fade System

Recommended Posts

Here is a simple automated trading system that has been exploiting an edge in the S&P futures market (ES) for over a year. The equity curve shows the performance of trading one contract and takes into account both slippage and commissions ($18.50 per trade).

 

attachment.php?attachmentid=20595&stc=1&d=1271205892

Equity Curve 2009-2010

($18.50 deducted per trade)

 

I attached the EasyLanguage code so you can experiment with it if you wish.

 

I create trading systems for TradeStation to exploit such edges. Edges in the market, such as this example, can appear and persist for months or even years. I attempt to find these and ride them until they begin to fail. How do I know when they fail? I usual use a simple moving average of the equity curve. When it begins to fall below the moving average then I stop trading it. Anyway, this is an example of an edge that I discovered last summer. I then created a simple trading system based around it and the edge continues today.

 

How does this system work? It's simple. I use RSI(9) to fade price extremes in the pre-market hours (600 - 830 Central). It can be traded on a 5-minute chart or 10-minute chart. The equity curve above is from a 5-minute chart. The system has a $150 profit target and a $250 stop which is typical for a trend fading system. That's it! The choppy nature of the ES market in the pre-market hours has really made this simple concept work. Of course the edge will not last forever! It could end this week or last for another year.

 

I bring this up because trading systems don't have to be complicated. Often what's more important is simply diversifying across different markets with different systems. That also implies being properly funded to trade a portfolio of systems.

 

Here is the code:

 

{== START OF HEADER ==========================================================================

Program: EE Morning Fade
Author:  Jeff65
Date:    August 2009

Platform:       TradeStation v8.6
Chart Settings: 5-minute bar 
Market:         ES

DESCRIPTION:

This program uses standard RSI to fade the market. Trades are entered at the extreme of the
signal bar on a limit ordrer. Trades are exited at market.

Learn More: http://www.eminiedges.com

== END OF HEADER =============================================================================}

Inputs:
Cntracts(1),
   TradeTimeStart(530),
   TradeTimeEnd(830),
profittarget$(150),
   stopLoss$( 250),
DayLoss$(250),
   RSI_Period(9),
   UpperLimit(70),
   LowerLimit(30);

Variables:

{ -- Software Version Information ------------------------------------------------------- }

vNumber("1.00"), // Current version of this software
vProductName("Morning Fade"),// Product name

  { -- Trading Variables ------------------------------------------------------------------ }

MarkPos       ( 0 ), // Market Position
TradeFlag ( false ), // Trade Flag. TRUE = activily trade
RetVal		  ( 0 ), // Return value place holder

{ -- Money Management ------------------------------------------------------------------- }

ATR(0),				// ATR at purchase
PLB4Today(0),		// P&L total before today
ProfToday(0),		// P&L total for today (NP + OPP - PLB4Today)
OPP(0),				// Open Position Profit
NP(0);				// Net P&L of all closed positions

{=== START OF PROGRAM  ======================================================================}

  If ( date <> date[1] ) Then
  Begin
     PLB4Today = NetProfit;
  End;

////////////////////////////////////////////////////////////////////////////
//
// Compute the current market position and reset TradeFlag to FALSE
//

MarkPos = MarketPosition;
TradeFlag = false;

  NP = NetProfit - PLB4Today;
  OPP = OpenPositionProfit;
  ProfToday = NP + OPP;


////////////////////////////////////////////////////////////////////////////
//
// Determine if current time is within valid market session. 
// This is done by setting the TradeFlag to TRUE which will allow
// new positions to be opened.
//

If ( Time > TradeTimeStart ) And ( Time < TradeTimeEnd ) Then
   TradeFlag = true;

If ( ProfToday <= -(DayLoss$) ) Then TradeFlag = false;

////////////////////////////////////////////////////////////////////////////
//
// If current time is within valid market session then we look for an
// opportunity to trade
//

If ( TradeFlag ) Then
Begin

	 If ( MarkPos = 0 ) Then
 Begin
    	If ( RSI( Close, RSI_Period ) < LowerLimit ) Then  Buy ("LE") Cntracts contract next bar at Low limit
    	Else If ( RSI( Close, RSI_Period ) > UpperLimit ) Then Sell Short("SE") Cntracts contract next bar at High limit;   
    	ATR = AvgTrueRange(13);
    End;

End
Else
Begin

    // Exit all positions when not in valid session

    If MarkPos = 1 then sell("Close All") next bar at market;
 If MarkPos = -1 then buytocover(" Close All") next bar at market;

End; 

If ( profittarget$ > 0 ) then SetProfitTarget( profitTarget$ );
SetStopLoss( stopLoss$ );

 

Jeff

Equity_Curve.png.9cc3b91058b3ecff5c9dc400aa86df29.png

Share this post


Link to post
Share on other sites

Hello,

 

Attached are two images of the trades made by the RSI Fading System (Morning Fade) for the month of April. The charts and graphs depict trades in my live account which, of course, takes into account slippage. The system enters on limit orders and if I'm not filled I don't take the trade. I'll wait until the next setup. Slippage most often occurs on the 830 Central exit and is 1 tick. Anyway, this market edge continues to hold well.

 

attachment.php?attachmentid=20844&stc=1&d=1272722627

 

attachment.php?attachmentid=20843&stc=1&d=1272722627

5aa70fffa5da7_MorningFadeResultsApril2010.png.8060fd537d54c1031f5eada25c966605.png

5aa70fffaa549_MorningFadeEQCurveApril2010.png.c0c9a607d9b4637b56a9fa965fc10471.png

Share this post


Link to post
Share on other sites

Very good idea.

add some filters can be very profitable system.

 

Hello,

 

Attached are two images of the trades made by the RSI Fading System (Morning Fade) for the month of April. The charts and graphs depict trades in my live account which, of course, takes into account slippage. The system enters on limit orders and if I'm not filled I don't take the trade. I'll wait until the next setup. Slippage most often occurs on the 830 Central exit and is 1 tick. Anyway, this market edge continues to hold well.

 

attachment.php?attachmentid=20844&stc=1&d=1272722627

 

attachment.php?attachmentid=20843&stc=1&d=1272722627

Share this post


Link to post
Share on other sites
Very good idea.

add some filters can be very profitable system.

 

While I can’t explain why, it is often the case that different days of the week show unique trading characteristics. I tested this day trading system across each day of the week. That is, what would the system performance look like if I just took trades on Mondays? How about Tuesday? And so on.

 

In short, Friday is a consistent loser and by not trading this ES scalping system on Friday, you can produce better performance results. I created some equity charts and a short video *removed promotional URL* to demonstrate what I did, for those who are interested.

 

Jeff

Share this post


Link to post
Share on other sites

 

{== START OF HEADER ==========================================================================

Program: EE Morning Fade
Author:  Jeff65
Date:    August 2009

Platform:       TradeStation v8.6
Chart Settings: 5-minute bar 
Market:         ES

DESCRIPTION:

This program uses standard RSI to fade the market. Trades are entered at the extreme of the
signal bar on a limit ordrer. Trades are exited at market.

Learn More: http://www.eminiedges.com

== END OF HEADER =============================================================================}

Inputs:
Cntracts(1),
   TradeTimeStart(530),
   TradeTimeEnd(830),
profittarget$(150),
   stopLoss$( 250),
DayLoss$(250),
   RSI_Period(9),
   UpperLimit(70),
   LowerLimit(30);

Variables:

{ -- Software Version Information ------------------------------------------------------- }

vNumber("1.00"), // Current version of this software
vProductName("Morning Fade"),// Product name

  { -- Trading Variables ------------------------------------------------------------------ }

MarkPos       ( 0 ), // Market Position
TradeFlag ( false ), // Trade Flag. TRUE = activily trade
RetVal		  ( 0 ), // Return value place holder

{ -- Money Management ------------------------------------------------------------------- }

ATR(0),				// ATR at purchase
PLB4Today(0),		// P&L total before today
ProfToday(0),		// P&L total for today (NP + OPP - PLB4Today)
OPP(0),				// Open Position Profit
NP(0);				// Net P&L of all closed positions

{=== START OF PROGRAM  ======================================================================}

  If ( date <> date[1] ) Then
  Begin
     PLB4Today = NetProfit;
  End;

////////////////////////////////////////////////////////////////////////////
//
// Compute the current market position and reset TradeFlag to FALSE
//

MarkPos = MarketPosition;
TradeFlag = false;

  NP = NetProfit - PLB4Today;
  OPP = OpenPositionProfit;
  ProfToday = NP + OPP;


////////////////////////////////////////////////////////////////////////////
//
// Determine if current time is within valid market session. 
// This is done by setting the TradeFlag to TRUE which will allow
// new positions to be opened.
//

If ( Time > TradeTimeStart ) And ( Time < TradeTimeEnd ) Then
   TradeFlag = true;

If ( ProfToday <= -(DayLoss$) ) Then TradeFlag = false;

////////////////////////////////////////////////////////////////////////////
//
// If current time is within valid market session then we look for an
// opportunity to trade
//

If ( TradeFlag ) Then
Begin

	 If ( MarkPos = 0 ) Then
 Begin
    	If ( RSI( Close, RSI_Period ) < LowerLimit ) Then  Buy ("LE") Cntracts contract next bar at Low limit
    	Else If ( RSI( Close, RSI_Period ) > UpperLimit ) Then Sell Short("SE") Cntracts contract next bar at High limit;   
    	[HIGHLIGHT YELLOW]ATR = AvgTrueRange(13);[/HIGHLIGHT YELLOW]     End;

End
Else
Begin

    // Exit all positions when not in valid session

    If MarkPos = 1 then sell("Close All") next bar at market;
 If MarkPos = -1 then buytocover(" Close All") next bar at market;

End; 

If ( profittarget$ > 0 ) then SetProfitTarget( profitTarget$ );
SetStopLoss( stopLoss$ );

 

Jeff

 

Hello Jeff

I know it is an old post, but do you remember why you used the ATR value?

 

Martin

Share this post


Link to post
Share on other sites
Hello Jeff

I know it is an old post, but do you remember why you used the ATR value?

 

Martin

 

 

Hey Martin. I simply picked it. I did no back testing or optimization on that number.

Share this post


Link to post
Share on other sites

I backtested your system on 5 years of data and it doesn't show good results, it does show better results starting from 2008 but still nowhere near the equity curve you are showing. I used 1 min OHLC data to test the strategy. I am not saying simple things don't work but this just seemed very suspicious to me that such a system would work and the backtest showed it wouldn't.

Share this post


Link to post
Share on other sites
I backtested your system on 5 years of data and it doesn't show good results, it does show better results starting from 2008 but still nowhere near the equity curve you are showing. I used 1 min OHLC data to test the strategy. I am not saying simple things don't work but this just seemed very suspicious to me that such a system would work and the backtest showed it wouldn't.

 

The graph at the beginning of this post is on a 5-minute chart. The system does not trade 1-minute bars because that's far too noisy. It was designed on 5-minute bars and I've also traded it on 10-minute bars.

 

Also during the development it was pointed out that this was a recent edge, that started in the last two years and probably won't last forever.

 

If you want to know more I posted some videos on my blog that show how I developed this system. You can find those videos here.

 

Again, this system probably has an edge that will not last forever. It's not a super great system. You're not going to get rich trading this system alone! But it's an example of finding an edge in the market and attempting to exploit it. If you watch the videos on how I created it you will get the main thrust which is, tips on developing a trading system.

 

Hope that helps.

Share this post


Link to post
Share on other sites

Thanks for your response. I retested the system with limit orders on 5 min bars and it shows similar to your results. The problem I would have with this system is that it's performance before October/November 2008 (incidentally this coincides with the market crash) is the exact opposite-equity curve steadily going down. In any case, I understand your logic and wish you luck trading it until it stops working. Just a quick question here. What drawdown will cause you to stop using this system? I am asking because the equity curve going back to 2005 has a sharp V shape with turning point in 2008, so once the equity curve starts going down you cannot be confident it's just a temporary blip or the system simply doesn't work anymore. Regardless of all the ranting here, I do like your systematic approach to researching market behaviour.

Share this post


Link to post
Share on other sites
Thanks for your response. I retested the system with limit orders on 5 min bars and it shows similar to your results. The problem I would have with this system is that it's performance before October/November 2008 (incidentally this coincides with the market crash) is the exact opposite-equity curve steadily going down. In any case, I understand your logic and wish you luck trading it until it stops working. Just a quick question here. What drawdown will cause you to stop using this system? I am asking because the equity curve going back to 2005 has a sharp V shape with turning point in 2008, so once the equity curve starts going down you cannot be confident it's just a temporary blip or the system simply doesn't work anymore. Regardless of all the ranting here, I do like your systematic approach to researching market behaviour.

 

That's a good question. One technique I like to use is to apply either a moving average to your your trading system’s equity curve. You'll have to try a few numbers to see what you like. By placing a simple moving average over your equity curve you create an indicator alerting you when to to stop trading and when to resume trading. You trade the system when the equity curve is above the moving average and stop trading it when it falls.

 

It's true you can't be certain if the drawdown is temporary or if the edge is simply gone. But by "trading the equity curve" this will help keep you out or alert you to when the system is experiencing long periods of drawdown.

 

I have a blog post on this with a short video demonstrating this concept here.

Share this post


Link to post
Share on other sites

I have quite literally scanned over the EasyLanguage that you have given, so may be about to completely misrepresent it, but would make the following suggestions:

 

a) the basic concept is not that disimilar to the 'swing trading' strategies described by Larry Connors, amongst others, in that it involves buying a short term oversold market back in the direction of the longer term trend. While this approach unoubtedly backtests well on daily charts, its performance is typically less impressive on intraday timeframes, where it will often produce highly profitable periods followed by similar losing periods.

 

b) I am not a big advocate of 'filtering' trading signals using multiple price-based indicators. Nevertheless, there is no denying that this particular approach benefits from such multiple indicator confirmations. Try combining the RSI with the Commodity Channel Index and a Value Chart, and then only taking those signals that meet at least two of the oversold conditions.

 

c) this type of strategy, in backtesting in the stock indices, shows a bias towards long positions that cannot be ignored. Though many would argue that this is an undesirable trait and an unjustifiable approach to trading a market, it is somewhat understandable; a large proportion of investors, both retail and institutional, are 'long only', and will look to buy a discounted market.

 

d) Has your 9 period setting for the RSI been properly backtested? I would strongly recommend that you examine the performance of this system with shorter RSI settings.

 

e) Are you confident that employing the ATR in your strategy is increasing its edge? What happens if you replace it with a stop and target derived from the MAE and MFE of past trades?

 

Hope that's of some help to those on this interesting thread. If I've misundertood anything let me know and I will read through the original code more carefully.

Share this post


Link to post
Share on other sites
You trade the system when the equity curve is above the moving average and stop trading it when it falls.here.

 

Though there's nothing -wrong- with what you're saying here, you're presenting one side of the 'equity curve trading' picture.

 

Assuming a strategy has a definite edge, then losing periods can be expected to follow winning periods, on a reversion-to-the-mean type basis, and so many would argue that it makes more sense to commence trading when the equity curve falls below its average (on the assumption that it will soon rise above it), and cease trading when it moves above it (on the assumption that a losing period is most likely just around the corner). This is the opposite to what you describe.

 

I am also guilty of not presenting the full picture; because the equity curve of a profitable strategy is likely to spend more sustained periods above its moving average, then ceasing trading above it is questionable. A sophisticated hedge fund approach may subtley adjust position sizing dependent on the state of the equity curve relative to its moving average, but unless you're lucky enough to be flipping hundreds of contracts, then this isn't much help to you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • My wife Robin just wanted some groceries.   Simple enough.   She parked the car for fifteen minutes, and returned to find a huge scratch on the side.   Someone keyed her car.   To be clear, this isn’t just any car.   It’s a Cybertruck—Elon Musk's stainless-steel spaceship on wheels. She bought it back in 2021, before Musk became everyone's favorite villain or savior.   Someone saw it parked in a grocery lot and felt compelled to carve their hatred directly into the metal.   That's what happens when you stand out.   Nobody keys a beige minivan.   When you're polarizing, you're impossible to ignore. But the irony is: the more attention something has, the harder it is to find the truth about it.   What’s Elon Musk really thinking? What are his plans? What will happen with DOGE? Is he deserving of all of this adoration and hate? Hard to say.   Ideas work the same way.   Take tariffs, for example.   Tariffs have become the Cybertrucks of economic policy. People either love them or hate them. Even if they don’t understand what they are and how they work. (Most don’t.)   That’s why, in my latest podcast (link below), I wanted to explore the “in-between” truth about tariffs.   And like Cybertrucks, I guess my thoughts on tariffs are polarizing.   Greg Gutfield mentioned me on Fox News. Harvard professors hate me now. (I wonder if they also key Cybertrucks?)   But before I show you what I think about tariffs… I have to mention something.   We’re Headed to Austin, Texas This weekend, my team and I are headed to Austin. By now, you should probably know why.   Yes, SXSW is happening. But my team and I are doing something I think is even better.   We’re putting on a FREE event on “Tech’s Turning Point.”   AI, quantum, biotech, crypto, and more—it’s all on the table.   Just now, we posted a special webpage with the agenda.   Click here to check it out and add it to your calendar.   The Truth About Tariffs People love to panic about tariffs causing inflation.   They wave around the ghost of the Smoot-Hawley Tariff from the Great Depression like it’s Exhibit A proving tariffs equal economic collapse.   But let me pop this myth:   Tariffs don’t cause inflation. And no, I'm not crazy (despite what angry professors from Harvard or Stanford might tweet at me).   Here's the deal.   Inflation isn’t when just a couple of things become pricier. It’s when your entire shopping basket—eggs, shirts, Netflix subscriptions, bananas, everything—starts costing more because your money’s worth less.   Inflation means your dollars aren’t stretching as far as they used to.   Take the 1800s.   For nearly a century, 97% of America’s revenue came from tariffs. Income tax? Didn’t exist. And guess what inflation was? Basically zero. Maybe 1% a year.   The economy was booming, and tariffs funded nearly everything. So, why do people suddenly think tariffs cause inflation today?   Tariffs are taxes on imports, yes, but prices are set by supply and demand—not tariffs.   Let me give you a simple example.   Imagine fancy potato chips from Canada cost $10, and a 20% tariff pushes that to $12. Everyone panics—prices rose! Inflation!   Nope.   If I only have $100 to spend and the price of my favorite chips goes up, I either stop buying chips or I buy, say, fewer newspapers.   If everyone stops buying newspapers because they’re overspending on chips, newspapers lower their prices or go out of business.   Overall spending stays the same, and inflation doesn’t budge.   Three quick scenarios:   We buy pricier chips, but fewer other things: Inflation unchanged. Manufacturers shift to the U.S. to avoid tariffs: Inflation unchanged (and more jobs here). We stop buying fancy chips: Prices drop again. Inflation? Still unchanged. The only thing that actually causes inflation is printing money.   Between 2020 and 2022 alone, 40% of all money ever created in history appeared overnight.   That’s why inflation shot up afterward—not because of tariffs.   Back to tariffs today.   Still No Inflation Unlike the infamous Smoot-Hawley blanket tariff (imagine Oprah handing out tariffs: "You get a tariff, and you get a tariff!"), today's tariffs are strategic.   Trump slapped tariffs on chips from Taiwan because we shouldn’t rely on a single foreign supplier for vital tech components—especially if that supplier might get invaded.   Now Taiwan Semiconductor is investing $100 billion in American manufacturing.   Strategic win, no inflation.   Then there’s Canada and Mexico—our friendly neighbors with weirdly huge tariffs on things like milk and butter (299% tariff on butter—really, Canada?).   Trump’s not blanketing everything with tariffs; he’s pressuring trade partners to lower theirs.   If they do, everybody wins. If they don’t, well, then we have a strategic trade chess game—but still no inflation.   In short, tariffs are about strategy, security, and fairness—not inflation.   Yes, blanket tariffs from the Great Depression era were dumb. Obviously. Today's targeted tariffs? Smart.   Listen to the whole podcast to hear why I think this.   And by the way, if you see a Cybertruck, don’t key it. Robin doesn’t care about your politics; she just likes her weird truck.   Maybe read a good book, relax, and leave cars alone.   (And yes, nobody keys Volkswagens, even though they were basically created by Hitler. Strange world we live in.) Source: https://altucherconfidential.com/posts/the-truth-about-tariffs-busting-the-inflation-myth    Profits from free accurate cryptos signals: https://www.predictmag.com/       
    • No, not if you are comparing apples to apples. What we call “poor” is obviously a pretty high bar but if you’re talking about like a total homeless shambling skexie in like San Fran then, no. The U.S.A. in not particularly kind to you. It is not an abuse so much as it is a sad relatively minor consequence of our optimism and industriousness.   What you consider rich changes with circumstances obviously. If you are genuinely poor in the U.S.A., you experience a quirky hodgepodge of unhelpful and/or abstract extreme lavishnesses while also being alienated from your social support network. It’s about the same as being a refugee. For a fraction of the ‘kindness’ available to you in non bio-available form, you could have simply stayed closer to your people and been MUCH better off.   It’s just a quirk of how we run the place and our values; we are more worried about interfering with people’s liberty and natural inclination to do for themselves than we are about no bums left behind. It is a slightly hurtful position and we know it; we are just scared to death of socialism cancer and we’re willing to put our money where our mouth is.   So, if you’re a bum; you got 5G, the ER will spend like $1,000,000 on you over a hangnail but then kick you out as soon as you’re “stabilized”, the logistics are surpremely efficient, you have total unchecked freedom of speech, real-estate, motels, and jobs are all natural healthy markets in perfect competition, you got compulsory three ‘R’’s, your military owns the sky, sea, space, night, information-space, and has the best hairdos, you can fill out paper and get all the stuff up to and including a Ph.D. Pretty much everything a very generous, eager, flawless go-getter with five minutes to spare would think you might need.   It’s worse. Our whole society is competitive and we do NOT value or make any kumbaya exception. The last kumbaya types we had werr the Shakers and they literally went extinct. Pueblo peoples are still around but they kind of don’t count since they were here before us. So basically, if you’re poor in the U.S.A., you are automatically a loser and a deadbeat too. You will be treated as such by anybody not specifically either paid to deal with you or shysters selling bejesus, Amway, and drugs. Plus, it ain’t safe out there. Not everybody uses muhfreedoms to lift their truck, people be thugging and bums are very vulnerable here. The history of a large mobile workforce means nobody has a village to go home to. Source: https://askdaddy.quora.com/Are-the-poor-people-in-the-United-States-the-richest-poor-people-in-the-world-6   Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.