moving average of RSI in ThinkOrSwim - futures io
futures io futures trading



moving average of RSI in ThinkOrSwim


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one kburks with 2 posts (0 thanks)
    2. looks_two SinSanDiego with 2 posts (0 thanks)
    3. looks_3 jeffro with 2 posts (4 thanks)
    4. looks_4 axl1 with 1 posts (0 thanks)
    1. trending_up 7,576 views
    2. thumb_up 5 thanks given
    3. group 5 followers
    1. forum 7 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

moving average of RSI in ThinkOrSwim

(login for full post details)
  #1 (permalink)
Boynton Beach
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES,TF,CL
 
kburks's Avatar
 
Posts: 200 since Mar 2012
Thanks: 324 given, 144 received

how to create a moving average of RSI in ThinkOrSwim PLEASE

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Neurological explanations for trading Success
Psychology and Money Management
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
Volume Profile Indicator for Ninja Script in NT8
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Big Mike in Ecuador
34 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
 
(login for full post details)
  #3 (permalink)
San Diego, CA/United States
 
Experience: Intermediate
Platform: TOS
Trading: ES, CL, 6A
 
Posts: 17 since Apr 2015
Thanks: 2 given, 11 received


Here you go:

declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input RSI_smoothing_averageType = AverageType.exponential;
input RSI_smoothing_length = 10;

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

def RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;

plot RSI_moving_average = MovingAverage(RSI_smoothing_averageType, RSI, RSI_smoothing_length);

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

Reply With Quote
The following 2 users say Thank You to jeffro for this post:
 
(login for full post details)
  #4 (permalink)
Boynton Beach
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES,TF,CL
 
kburks's Avatar
 
Posts: 200 since Mar 2012
Thanks: 324 given, 144 received

Thanks so much, how to I get the code from here to the platform?

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
San Diego, CA/United States
 
Experience: Intermediate
Platform: TOS
Trading: ES, CL, 6A
 
Posts: 17 since Apr 2015
Thanks: 2 given, 11 received

No worries.

Highlight and copy all the code I supplied. Open ThinkorSwim and go to charts, then click studies-->edit studies. A window will pop up and select "new" in the bottom left corner. A new script window will pop up. Clear out the window of any text code in there and paste the code you copied. You can change the name at the top of the window if you like. Hit "ok" and the indicator is now available.

Keep me posted on how it works for you. If you need any others let me know. I may be able to code it or already may have it coded.
-Jeff

Reply With Quote
The following 2 users say Thank You to jeffro for this post:
 
(login for full post details)
  #6 (permalink)
Del Mar, CA
 
 
Posts: 2 since Mar 2021
Thanks: 1 given, 0 received

Not sure if this is the most appropriate place to ask this question, but stumbled on this thread and am hoping someone can help me create a ThinkorSwim script which will chart RSI with 2 (two) moving averages, rather than just one--a 9 period SMA (shown in green) and 45 period WMA (shown in red), atop the raw RSI (in black). Am happy to pay someone to help me with this if necessary. Many thanks.

Reply With Quote
 
(login for full post details)
  #7 (permalink)
San Diego, CA
 
Experience: Beginner
Platform: TOS, Sierra
Trading: Emini ES, Crude CL
 
Posts: 33 since Mar 2019
Thanks: 4 given, 22 received

Let me know if this is what you wanted. I used the TOS RSI code as a starting point and added the averages at the bottom.

 
Code
declare lower;

input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;

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

plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSI crosses above OverSold then OverSold else Double.NaN;
plot DownSignal = if RSI crosses below OverBought then OverBought else Double.NaN;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

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));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

input average1Type = AverageType.SIMPLE;
input average1Length = 9;
input average2Type = AverageType.WILDERS;
input average2Length = 45;

plot avg1 = MovingAverage(average1Type, RSI, average1Length);
avg1.setDefaultColor(Color.GREEN);
plot avg2 = MovingAverage(average2Type, RSI, average2Length);
avg2.setDefaultColor(Color.RED);

Reply With Quote
The following user says Thank You to JayC for this post:
 
(login for full post details)
  #8 (permalink)
Del Mar, CA
 
 
Posts: 2 since Mar 2021
Thanks: 1 given, 0 received

Thank you, JayC. Your code works nicely. Wishing you good fortune with your trading.

Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > moving average of RSI in ThinkOrSwim


Last Updated on March 6, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts