NexusFi: Find Your Edge


Home Menu

 





Eurhythmic RSI - A Smoothed Double RSI


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one vmodus with 3 posts (3 thanks)
    2. looks_two Midline with 3 posts (3 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Shaban with 1 posts (0 thanks)
    1. trending_up 2,290 views
    2. thumb_up 6 thanks given
    3. group 5 followers
    1. forum 7 posts
    2. attach_file 4 attachments




 
Search this Thread

Eurhythmic RSI - A Smoothed Double RSI

  #1 (permalink)
Midline
Basking Ridge
 
Posts: 7 since Mar 2020
Thanks Given: 2
Thanks Received: 9

I don't use indicators but I do plot the RSI sometimes to gauge how far price may go up or down. However, the default RSI is too ragged so I decided to write a smoother version by using a weighted average as input rather than the close price. I call it the Eurhythmic RSI.

This is a double RSI. The "fast" version uses a wma of the close while the "slow" version uses a wma of the open. When the fast line is above the slow line it denotes an uptrend and vice versa. The indicator alerts you when it enters the over bought/sold zone and it also alerts you when it leaves those zones.

If you trade the daily you can plot this on the weekly to get a general sense of the market direction to facilitate your trades. You can use the 4H for entries when in the over bought/sold regions while consulting the weekly and daily Eurhythmic RSIs.

I've posted 2 screen shots of EUR/USD. One a daily comparing the Eurhythmic RSI with the stock RSI and another of a 4H chart also comparing the two RSIs. All RSIs are 7 period. The time periods on the charts don't match.

I'm new to EasyLanguage programming so if you have any feedback on improving my code please do let me know.

Enjoy!


Daily Chart of the EUR/USD


4H Chart of the EUR/USD



 
Code
// -----------------------------------------------------------------------------------------
// ! Eurhythmic RSI - Double RSI using Avg(close) and Avg(open)
// -----------------------------------------------------------------------------------------
// Copyright	: Creative Commons - Attribution-ShareAlike (CC BY-SA)
// Author		: User: Midline (Futures.io Forum)
// Date			: March 16, 2020
// Version		: 1.0
// ----------------------------------------------------------------------------------------

inputs:
		RsiLen				( 7 ),							// RSI Inputs
		OverSold			( 15 ),
		OverBought		( 85 ),
		MidlineColor		( lightgray ),
		OverSColor		( DarkGreen ), 
		OverBColor		( Red ),

		AvgLen 				( 5 ),							// Average Inputs
		AvgSmoothLen 	( 3 )   ;

variables: 
		rsiOpen ( 0 ), 
		rsiClose( 0 )   ;


rsiClose = RSI( WAverage( WAverage(close,AvgSmoothLen), AvgLen ), RsiLen ) ;
rsiOpen  = RSI( WAverage( WAverage(open,AvgSmoothLen), AvgLen ), RsiLen ) ;

// Change color of RSI lines in Over Bought/Sold zones
     if( rsiClose > OverBought ) then SetPlotColor( 1, OverBColor   )
else if( rsiClose < OverSold   ) then SetPlotColor( 1, OverSColor   )
																 else SetPlotColor( 1, MidlineColor )   ;

	   if( rsiOpen > OverBought ) then SetPlotColor( 2, OverBColor   ) 
else if( rsiOpen < OverSold   ) then SetPlotColor( 2, OverSColor   ) 
															  else SetPlotColor( 2, MidlineColor )   ;

Plot1( rsiClose, "RSI Close" ) ;
Plot2( rsiOpen, "RSI Open"   ) ;
Plot3( OverBought, "OverBot" ) ;
Plot4( 50, "Midline"         ) ;
Plot5( OverSold, "OverSld"   ) ;

// Set Alerts for ENTERING / LEAVING OB & OS Zones
if ( alertenabled ) then
			   if( rsiOpen crosses over OverBought  ) then  Alert( "RSI IN Over BOUGHT Zone"      )
		else if( rsiOpen crosses under OverSold   ) then  Alert( "RSI IN Over SOLD Zone"        )
		else if( rsiOpen crosses under OverBought ) then  Alert( "RSI Leaving Over BOUGHT Zone" )
		else if( rsiOpen crosses over OverSold    ) then  Alert( "RSI Leaving Over SOLD Zone"   ) ;

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
Trend Direction Force Index (TDFI)
Platforms and Indicators
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853



Midline View Post
This is a double RSI. The "fast" version uses a wma of the close while the "slow" version uses a wma of the open. When the fast line is above the slow line it denotes an uptrend and vice versa. The indicator alerts you when it enters the over bought/sold zone and it also alerts you when it leaves those zones.

I have a couple of thoughts on this:

1) I don't like RSI, but that is my personal opinion and experience. It does not add any value to the way I trade.

Now that I have that out of the way....

2) WMA's have been shown to be less than effective compared to other commone smoothing methods (I don't have my source off-hand, but I have found this to be true as well). EMA or other smoothed moving average may be better.

If you are into experimentation with smoothing, I would suggest taking a look at John Ehler's work on smoothed RSI. He is big into signal smoothing and reducing signal lag. I have used his Super Smoother idea on a couple of custom indicators. Anyhow, his last book, Cycle Analytics for Traders has 'Adaptive RSI'.

If you subscribe to TASC, then you will find a number of articles by Ehler's in the archives, along with EasyLanguage code. You may find some more RSI stuff there.

Some of his older code can be found here: John Ehlers code links
I have noticed that some of the code needs to be tweaked to avoid division by zero errors.

Again, I'm not an RSI guy, but I hope this helps you.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

So I added your indicator to a 5 minute ES chart (default value of 7 RsiLen) and compared it with a 14 period Adaptive RSI (John Ehler's) and 14 period Fisher Transform. I see a lot of similarity of your indicator with the Fisher Transform (which is why I put it on the chart).



In any case, your indicator is very interesting.

Just for fun (and who knows what I came up with as a result), I modified the indicator using EMA instead of WMA. Below shows both on a 5 minute ES chart (EMA above; WMA below), same inputs:



I used the XAverageOrig function instead of the XAverage function; code is here:

 
Code
{
// -----------------------------------------------------------------------------------------
// ! Eurhythmic RSI EMA - Double RSI using Avg(close) and Avg(open)
// -----------------------------------------------------------------------------------------
// Copyright   : Creative Commons - Attribution-ShareAlike (CC BY-SA)
// Author      : User: Midline (Futures.io Forum)
// Date         : March 16, 2020
// Version      : 1.0
// https://nexusfi.com/easylanguage-programming/52680-eurhythmic-rsi-smoothed-double-rsi.html

   Mods by vmodus:
      change WAverage to XAverageOrig        

// ----------------------------------------------------------------------------------------
}
inputs:
      RsiLen            (7),                     // RSI Inputs
      OverSold         (15),
      OverBought      (85),
      MidlineColor      (lightgray),
      OverSColor      (DarkGreen), 
      OverBColor      (Red),

      AvgLen             (5),                     // Average Inputs
      AvgSmoothLen    (3)   ;

variables: 
      rsiOpen (0), 
      rsiClose(0)   ;



rsiClose = RSI( XAverageOrig( XAverageOrig(close,AvgSmoothLen), AvgLen ), RsiLen ) ;
rsiOpen  = RSI( XAverageOrig( XAverageOrig(open,AvgSmoothLen), AvgLen ), RsiLen ) ;


// Change color of RSI lines in Over Bought/Sold zones
     if( rsiClose > OverBought ) then SetPlotColor( 1, OverBColor   )
else if( rsiClose < OverSold   ) then SetPlotColor( 1, OverSColor   )
                                                 else SetPlotColor( 1, MidlineColor )   ;

      if( rsiOpen > OverBought ) then SetPlotColor( 2, OverBColor   ) 
else if( rsiOpen < OverSold   ) then SetPlotColor( 2, OverSColor   ) 
                                               else SetPlotColor( 2, MidlineColor )   ;

Plot1( rsiClose, "RSI Close" ) ;
Plot2( rsiOpen, "RSI Open"   ) ;
Plot3( OverBought, "OverBot" ) ;
Plot4( 50, "Midline"         ) ;
Plot5( OverSold, "OverSld"   ) ;

// Set Alerts for ENTERING / LEAVING OB & OS Zones
if ( alertenabled ) then
            if( rsiOpen crosses over OverBought  ) then  Alert( "RSI IN Over BOUGHT Zone"      )
      else if( rsiOpen crosses under OverSold   ) then  Alert( "RSI IN Over SOLD Zone"        )
      else if( rsiOpen crosses under OverBought ) then  Alert( "RSI Leaving Over BOUGHT Zone" )
      else if( rsiOpen crosses over OverSold    ) then  Alert( "RSI Leaving Over SOLD Zone"   ) ;
~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
Midline
Basking Ridge
 
Posts: 7 since Mar 2020
Thanks Given: 2
Thanks Received: 9

Thank you for your very informative post and thoughts on the RSI. I shall certainly experiment with an EMA version of the RSI and will look up the resources you've mentioned on John Ehler's work.

I don't use indicators, including moving averages, and prefer to trade the naked chart. I use market structure and price action to trade. However, sometimes it is unclear (to me) as to how far price might retrace and for that reason I plot the RSI so that I may get a general idea. Based on the clues provided by the RSI I then apply price action to place my order.

BTW, I'm finding it quite challenging to code an EA based on market structure and I'm finding that the language constructs, or rather the lack of data structures and domain specific constructs, exacerbate this challenge. Easy language might be easy but it is certainly not conducive to writing EAs. Another challenge I have is that MultiCharts is so buggy that I fear that even if I manage to write an EA I likely will not be able to run it effectively on Multicharts. I'll probably create a separate thread for these challenges as time permits. Perhaps I'm overlooking something.

Thanks again for your input on the Eurhythmic RSI.

Reply With Quote
Thanked by:
  #6 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


Midline View Post
Thank you for your very informative post and thoughts on the RSI. I shall certainly experiment with an EMA version of the RSI and will look up the resources you've mentioned on John Ehler's work.

I don't use indicators, including moving averages, and prefer to trade the naked chart. I use market structure and price action to trade. However, sometimes it is unclear (to me) as to how far price might retrace and for that reason I plot the RSI so that I may get a general idea. Based on the clues provided by the RSI I then apply price action to place my order.

BTW, I'm finding it quite challenging to code an EA based on market structure and I'm finding that the language constructs, or rather the lack of data structures and domain specific constructs, exacerbate this challenge. Easy language might be easy but it is certainly not conducive to writing EAs. Another challenge I have is that MultiCharts is so buggy that I fear that even if I manage to write an EA I likely will not be able to run it effectively on Multicharts. I'll probably create a separate thread for these challenges as time permits. Perhaps I'm overlooking something.

Thanks again for your input on the Eurhythmic RSI.

You're welcome. Maybe you want to look at .NET for MultiCharts, if you have that skillset. I know in MC you have to pay to change your version from EL to .NET. I believe you use C# in TradeStation, if you are so inclined.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
Midline
Basking Ridge
 
Posts: 7 since Mar 2020
Thanks Given: 2
Thanks Received: 9

I'm contemplating whether I should build my own trading platform. I hesitate only because it would require many months of full time effort even to build a minimum viable product.

The current offerings in the market are all sorely lacking in many aspects, both functionally and from a UX perspective. They were likely not designed by traders.

Reply With Quote
  #8 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129


Midline View Post
I'm contemplating whether I should build my own trading platform. I hesitate only because it would require many months of full time effort even to build a minimum viable product.

For Midline, you have a PM

Reply With Quote




Last Updated on April 29, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts