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

    • Date: 22nd November 2024.   BTC flirts with $100K, Stocks higher, Eurozone PMI signals recession risk.   Asia & European Sessions:   Geopolitical risks are back in the spotlight on fears of escalation in the Ukraine-Russia after Russia reportedly used a new ICBM to retaliate against Ukraine’s use of US and UK made missiles to attack inside Russia. The markets continue to assess the election results as President-elect Trump fills in his cabinet choices, with the key Treasury Secretary spot still open. The Fed’s rate path continues to be debated with a -25 bp December cut seen as 50-50. Earnings season is coming to an end after mixed reports, though AI remains a major driver. Profit taking and rebalancing into year-end are adding to gyrations too. Wall Street rallied, led by the Dow’s 1.06% broadbased pop. The S&P500 advanced 0.53% and the NASDAQ inched up 0.03%. Asian stocks rose after  Nvidia’s rally. Nikkei added 1% to 38,415.32 after the Tokyo inflation data slowed to 2.3% in October from 2.5% in the prior month, reaching its lowest level since January. The rally was also supported by chip-related stocks tracked Nvidia. Overnight-indexed swaps indicate that it’s certain the Reserve Bank of New Zealand will cut its policy rate by 50 basis points on Nov. 27, with a 22% chance of a 75 basis points reduction. European stocks futures climbed even though German Q3 GDP growth revised down to 0.1% q/q from the 0.2% q/q reported initially. Cryptocurrency market has gained approximately $1 trillion since Trump’s victory in the Nov. 5 election. Recent announcement for the SEC boosted cryptos. Chair Gary Gensler will step down on January 20, the day Trump is set to be inaugurated. Gensler has pushed for more protections for crypto investors. MicroStrategy Inc.’s plans to accelerate purchases of the token, and the debut of options on US Bitcoin ETFs also support this rally. Trump’s transition team has begun discussions on the possibility of creating a new White House position focused on digital asset policy.     Financial Markets Performance: The US Dollar recovered overnight and closed at 107.00. Bitcoin currently at 99,300,  flirting with a run toward the 100,000 level. The EURUSD drifts below 1.05, the GBPUSD dips to June’s bottom at 1.2570, while USDJPY rebounded to 154.94. The AUDNZD spiked to 2-year highs amid speculation the RBNZ will cut the official cash rate by more than 50 bps next week. Oil surged 2.12% to $70.46. Gold spiked to 2,697 after escalation alerts between Russia and Ukraine. Heightened geopolitical tensions drove investors toward safe-haven assets. Gold has surged by 30% this year. Haven demand balanced out the pressure from a strong USD following mixed US labor data. Silver rose 0.9% to 31.38, while palladium increased by 0.9% to 1,040.85 per ounce. Platinum remained unchanged. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news. Andria Pichidi HFMarkets Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • A few trending stocks at support BAM MNKD RBBN at https://stockconsultant.com/?MNKD
    • BMBL Bumble stock watch, pull back to 7.94 support area with high trade quality at https://stockconsultant.com/?BMBL
    • LUMN Lumen Technologies stock watch, pull back to 7.43 support area with bullish indicators at https://stockconsultant.com/?LUMN
×
×
  • Create New...

Important Information

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