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

    • This should really be very easy, but I can't find an article or video to walk me through it. I picked 20 ticker symbols where the stocks are in a tight trading range. I got them all into one list I call "Channel". I'd like to add several indicators that apply to all, such as MACD, volume, 3 moving averages. Then I'd like to scroll through the list, adding trendlines, or horizontal lines to mark the top & bottom of the price channel for each. Then set an alarm for a breakout in each direction that indicates a breakout. Could you point me to an article or video that walks me through how to do this? ...or give me the steps? Thank you, RichardV2, Experienced stock trader back before the Internet was invented.😁
    • The Economic Proscription of U.S. Farmers by China Maybe Forever   Similar to a black eye on the face, it’s placing an indelible imprint. The retaliatory levies by China over U.S. commodity producers, such as soybeans, which seem to be forever. The moment such happens for the market it becomes irreversible.   It’s a dread numerous farmers from North Dakota to Mississippi have recognized for as far back as last year. They worry that they’ve put millions in soybean development on account of China. Since Chinese focus is now transferred towards Brazil rather, that market might be gone forever.   Once the confidence merchants have in the U.S. declines as a steady provider because of the trade dispute, the more vital its important for them to support and further broaden other avenues.   The developing danger for American agribusiness presently is that a great part of the piece of the overall industry lost throughout the year will be hard or difficult to win back at any point shortly, the Boston Consulting Group said in a detailed analysis discharged on Wednesday.   This is for the most part because of long term contracts that are regularly recorded among purchasers and sellers, contingent upon the item. The lesson from the analysis shows that U.S. farmers need to turn out to be less reliant on China, and simply trust in the best concerning those customers organizing a rebound sooner or later.   For the time being, China is going to Australia, Brazil, New Zealand, Russia, and also for its domestic producers as an option in contrast to American developed crops and animal proteins.   From the detailed analysis: “The risk that U.S. agribusinesses may for all time lose foreign market share of the overall industry isn’t only hypothetical. In past trade disputes, for example, one with China including beef, the US has not recaptured its lost share. As a result of the increase of U.S. crops and food materials more costly than other choices, high duties bring down the price to merchants who plan to expand. Also, the fewer confidence merchants have in the US as a steady provider, in perspective on the potential for future trade disputes, the more important it progresses toward becoming for them to support and further expand. After some time, merchants could loosen up complex associations with suppliers from the U.S.”   China Receives Blames for the Pressure And this is so because China is important to American farmers. China purchased $19.5 billion in U.S. agricultural items as of 2017, representing 14% of exports of farm produce, in light of BCS analysis. In July 2018, China slammed a 25% levy on U.S. agricultural items.   Exports at that point declined by an incredible 53% for the year. While exports to China have declined also for this year, over past years free fall.   There is another motivation behind why some China customers may not come back to the U.S. China is extending its very own crop acreage, particularly for soybeans. After some time, China will turn out to be progressively independent. Except if request increases generously, China will purchase its very own soybeans, regulating export development and under control in any case.   “Individuals in the business were in a condition of cheerfulness, believing that a bargain would soon be reached,” says Michael McAdoo, associate, and related executive for BCS in Montreal. “Our analysis demonstrates that regardless of whether there is a bargain, there is worry that a similar volume won’t return. They need to try different markets,” he declared.   Source: https://learn2.trade 
    • Trade Dispute Responsible for China’s Overwhelming Gold Purchase Rate   China has included more than 100 tons of gold to its stores since it continued purchasing in December, fortifying its position as one of the significant authority collectors as national banks load up on the valuable metal.   The People’s Bank of China grabbed progressively gold a month ago, raising reserves to 62.64 million ounces in September from 62.45 million in August, as per information on its site. In tonnage terms, the most recent inflow sums 5.9 tons and comes in as an expansion of about 99.8 tons over the earlier nine months.   Bullion hit the most noteworthy in over six years in September as more slow development, the trade dispute and rate reductions prodded financial specialist request. National banks have been significant purchasers as well, particularly in developing markets. Administrative demands will probably proceed as protectionist strategies and geopolitical concerns add to the request, as forecasted by Suki Cooper, the valuable metals investigator at Standard Chartered Bank.   “With the stressed partnerships with the U.S., China requires support against its enormous possessions of the dollar, and gold serves that capacity,” said Howie Lee, a financial specialist at Singapore-based Oversea-Chinese Banking Corp. “As China turns into a superpower in its very own right, I anticipate progressively gold-purchases.”   China’s High Gold Appetite The PBOC’s continuos running of bullion-purchasing has come against the difficult setting of the trade dispute with the U.S. furthermore, a stamped lull in development at home. While high-level discussions are set to continue in Washington this week, Chinese authorities are flagging they’re progressively hesitant to consent to an expansive bargain.   Spot gold spiked to as much as 0.4% to $1,511.31 an ounce on Monday and exchanged at $1,505.84 in early London exchange. While the value declined 3.2% in September, they remain high at 17% this year. The PBOC information was discharged at the end of the week. Alongside China, Russia has additionally been including generous amounts of bullion. In the initial half-year, national banks overall got 374.1 tons, supporting the overall gold request to a three-year high, the World Gold Council declared.   While a tenth straight month of amassing, shows an unfaltering purchasing trend for the PBOC, China has in the past gone for significant stretches without uncovering moves for its gold possessions. At the point the national bank declared a 57% bounce in savings to 53.3 million ounces in mid-2015, that was the first update in quite a while.   Source: https://learn2.trade   
    • GBPJPY Reverses Its Sell-Off Around the Level at 130.75  OCTOBER 9, 2019  Azeez Mustapha  No Comments   GBPJPY Price Analysis – October 9 In the prior session, the pair closed lower for the second day in a row, but currently, the GBPJPY displays a weakness further downside of the pair while retaining its wider medium-term outlook by temporal reversal on the level at 130.75.   Key Levels Resistance Levels: 148.66, 137.80, 135.774 Support Levels: 130.75, 128.68, 126.54   GBPJPY Long term Trend: Bearish In the bigger picture, the GBPJPY consolidation structure is still forming from the technical support zone on the level at 126.54 low.   A further upward move may be recorded towards the level at 146.57 and 148.66 in an extension where its resistance is glaring before completing the structure. However, the overall trend remains bearish while displaying an intact downtrend in the medium and long-term.   GBPJPY Short term Trend: Bearish On the 4-hour time frame, its price is trading narrowly between the moving average 5 and 13 close to the key technical support level at 130.44.   As it is presently, the intraday bias in GBPJPY remains on the downside at this point where a corrective rebound from the level at 126.54 low should have completed. Meanwhile, its 4-hour RSI is bearish and pointing lower suggesting further weakness.   Source: https://learn2.trade 
    • USDCHF Breaks Below Its near Term Support Zone on the Level at 0.9926 but Recovers Abruptly USDCHF Price Analysis – October 8 The FX pair breaks below the horizontal zone on the level at 0.9926 but reverses again after recovering from its early selling pressure. The USDCHF was able to find buyers again around the level at 0.9908.   Key Levels   Resistance Levels: 1.0231, 1.0126, 1.0015   Support Levels: 0.9897, 0.9870, 0.9843   USDCHF Long term Trend: Ranging The price of the pair has moved back towards the moving average of 5 and 13 areas on the level at 0.9950. This area requires to be broken to give buyers more upside potential to move higher.   However, the decisive break of the level at 1.0231 is required to indicate bullish resumption. Meanwhile, the medium and longer-term may remain neutral first.   USDCHF Short term Trend: Bearish After trending downwards to about 50 pips lower after the open, the forex pair managed to reverse during the session as bulls took control and may exit the day above its opening price.   The USDCHF’s pull back from the level at 1.0015 extends lower today but stays well above the lower horizontal zone on the level at 0.9843 support. While still in a long-term uptrend, the short trends have turned bearish already.   Source: https://learn2.trade   
×
×
  • Create New...

Important Information

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