NexusFi: Find Your Edge


Home Menu

 





How to add a moving average to RSI


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one Werd with 3 posts (0 thanks)
    2. looks_two WilleeMac with 1 posts (0 thanks)
    3. looks_3 devd12 with 1 posts (0 thanks)
    4. looks_4 devildriver6 with 1 posts (0 thanks)
    1. trending_up 22,946 views
    2. thumb_up 4 thanks given
    3. group 8 followers
    1. forum 9 posts
    2. attach_file 2 attachments




 
Search this Thread

How to add a moving average to RSI

  #1 (permalink)
Werd
Colorado Springs, Colorado USA
 
Posts: 9 since Sep 2012
Thanks Given: 4
Thanks Received: 1

Can someone give me the rundown on exactly how to add a moving average to Wilder's RSI for TOS? Can you put a Hull Moving average on RSI? Thanks, I really appreciate any help.

Drew

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Increase in trading performance by 75%
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Tao te Trade: way of the WLD
24 thanks
Diary of a simple price action trader
22 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #2 (permalink)
 
RedK's Avatar
 RedK 
Dubai, UAE
 
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145


Werd View Post
Can someone give me the rundown on exactly how to add a moving average to Wilder's RSI for TOS? Can you put a Hull Moving average on RSI? Thanks, I really appreciate any help.

Drew

@Werd, create a new study and copy any of the below codes to it..
the first is a plain, fast and simple one that calls the existing RSI_Wilder then smoothes it .. the second is a full copy of the RSI_Wilder built-in study, then adding the HMA smoothing to it at the end.. this way you still get the OB/OS levels and dynamics color line...etc from the original code.

Simple way

 
Code
Declare Lower;
Input Length = 14; Input HMASmoothing = 4;
def  RSI = RSIWilder(Length);
Plot MySmoothRSI = HullMovingAvg (RSI, HMASmoothing);
Longer way (nicer)

 
Code
declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
Input HMASmoothing = 4; ##Added an input line for smoothing value

def NetChgAvg = WildersAverage(price - price[1], length);
def TotChgAvg = WildersAverage(AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI_Raw = 50 * (ChgRatio + 1); ## changed the name to RSI_Raw
plot OverSold = over_Sold;
plot OverBought = over_Bought;

Plot RSI = HullMovingAvg (RSI_Raw, HMASmoothing); ## Added our smoothing

RSI.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
Werd
Colorado Springs, Colorado USA
 
Posts: 9 since Sep 2012
Thanks Given: 4
Thanks Received: 1


Sorry it took me so long to say thanks very much for replying to my question. I very much appreciate it!

Sincerely,

Drew

Reply With Quote
  #4 (permalink)
Werd
Colorado Springs, Colorado USA
 
Posts: 9 since Sep 2012
Thanks Given: 4
Thanks Received: 1

Is there a way to add a moving average to any indicator, and still have the indicator on the chart? Such as, for Wilder's RSI, have the RSI plot with the moving average also on the chart, not just the smoothing of the RSI?

I'd liek to be able to add moving averages to various indicators, but have the actual moving average line on the chart and not just have the indicator smoothed. Thanks.

Reply With Quote
  #5 (permalink)
devd12
Irvine, CA
 
Posts: 2 since Sep 2013
Thanks Given: 0
Thanks Received: 0

create a new indicator and just paste this script.. this script assumes RSI length of 14 periods.. and the moving average length of 5 periods.. so the moving average should be the average of the last 5 values of the RSI.. hope this helps ..

declare lower;
input RSILength = 14;
input MALength = 5;
plot RSI = RSIWilder(RSILength);
Plot MA = Average(RSI,MALength);

Reply With Quote
  #6 (permalink)
 
WilleeMac's Avatar
 WilleeMac 
Prospect, KY. USA
 
Experience: None
Platform: Sierra Chart
Broker: Infinity
Trading: /CL
Posts: 687 since Jan 2012
Thanks Given: 309
Thanks Received: 617

@RedK

Thank you for the code

I took your code and added a standard Wilders RSI only for comparison purposes etc

-Bill_M

Attached Files
Elite Membership required to download: Hull_RSIandRSI.doc
Follow me on Twitter Reply With Quote
  #7 (permalink)
 jlwade123   is a Vendor
 
Posts: 929 since Oct 2012
Thanks Given: 684
Thanks Received: 897


Werd View Post
Is there a way to add a moving average to any indicator, and still have the indicator on the chart? Such as, for Wilder's RSI, have the RSI plot with the moving average also on the chart, not just the smoothing of the RSI?

I'd liek to be able to add moving averages to various indicators, but have the actual moving average line on the chart and not just have the indicator smoothed. Thanks.

Yes, I do it in Ninja Trader by just clicking EMA and adding it to chart 2 as an overlay. You can do it that way leaving the input as the crude contract or euro contract or whatever your main price contract is in; or, also you can change the input for the ema overlay to RSI, and then add the double smoothed ema overlay to the RSI indicator in chart 2.

Follow me on Twitter Reply With Quote
  #8 (permalink)
devildriver6
Dallas, Texas
 
Posts: 43 since Jun 2015
Thanks Given: 2
Thanks Received: 32


devd12 View Post
create a new indicator and just paste this script.. this script assumes RSI length of 14 periods.. and the moving average length of 5 periods.. so the moving average should be the average of the last 5 values of the RSI.. hope this helps ..

declare lower;
input RSILength = 14;
input MALength = 5;
plot RSI = RSIWilder(RSILength);
Plot MA = Average(RSI,MALength);

What about adding it to another indicator, NOT an RSI?

Reply With Quote
  #9 (permalink)
ChrisvanderBerg
Vryburg , South Africa
 
Posts: 2 since Sep 2020
Thanks Given: 2
Thanks Received: 0

Hi Everyone,

Is it possible to change this script into mql4 format.
I use something similar , RSi ,14 ; SMA ,1 ; SMA,800 on my sell phone by adding the SMA's to the RSI indicator, however I do not get the same results when I apply the same principles to my MetaTrader 4
See attachment

Attached Thumbnails
Click image for larger version

Name:	IMG_1387.PNG
Views:	355
Size:	335.8 KB
ID:	304755  
Reply With Quote
  #10 (permalink)
 DaveJ 
Sacramento ca/USA
 
Experience: Intermediate
Platform: ScottrardeElite
Trading: Stocks
Posts: 1 since Sep 2013
Thanks Given: 0
Thanks Received: 0


I believe you can do this without code in ToS...

Using the original use case, add RSI and Moving Average indicators as Studies. While still in the Studies window, drag and drop Moving Average indicator onto RSI. Both indicators should now display in the Studies window without a separating line.

Hope this works for you.

Reply With Quote




Last Updated on September 12, 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