Rainbow Adaptive RSI For ThinkOrSwim

samer800

Moderator - Expert
VIP
Lifetime
QX08g1p.png


Author Message:

The following oscillator uses an adaptive moving average as an input for another RSI oscillator and aims to provide a way to minimize the impact of retracements over the oscillator output without introducing significant lag.

An additional trigger line is present in order to provide entry points from the crosses between the oscillator and the trigger line.
More details : https://www.tradingview.com/v/ZIO3hXCd/

CODE:

CSS:
# https://www.tradingview.com/v/ZIO3hXCd/
#// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
#// © LuxAlgo
#study("Rainbow Adaptive Rsi","RAR [LuxAlgo]")
# Converted by Sam4Cok@Samer800    - 08/2023

declare lower;
input colorBars = yes;
input length   = 15;        # "??Length"
input power    = 1.0;       # "??Power"
input src      = close;     # "??Source"
input ColorFill  = yes;     # "??Color Fill"
input showCrosses = yes;    # "??Circles"

def na = Double.NaN;
def last = isNaN(close);
#//Rsi[------------
def ama;#     = 0.
def diff = src - ama[1];
def rsi1 = rsi(Price = diff,Length = length);
def alpha   = AbsValue(rsi1/100 - 0.5);
    ama     = CompoundValue(1, ama[1] + power(alpha,power) * (src - ama[1]), src);
def rsi     = rsi(Price= ama, Length = length);
def len2    = floor(length/2);
def ema2    = ExpAverage(src,len2);
def rsi2    = rsi(Price = ema2,Length = length);
def trigger = ExpAverage(rsi2,len2);

#//Plots[--

plot A = rsi;
plot B = trigger;

A.AssignValueColor(CreateColor(255 - rsi * 2.0, rsi * 2.55, 0));
A.SetLineWeight(2);
B.AssignValueColor(CreateColor(255 - rsi * 2.0, rsi * 2.55, 0));

AddCloud(if !ColorFill then na else if A>80 then A else na, B, Color.GREEN);
AddCloud(if !ColorFill then na else if A<20 then B else na, A, Color.RED);

AddCloud(if !ColorFill then na else if A<=80 and A > 60 then A else na, B, Color.DARK_GREEN);
AddCloud(if !ColorFill then na else if A<=60 and A > 50 then A else na, B, Color.DARK_GREEN);

AddCloud(if !ColorFill then na else if A>=20 and A< 40 then B else na, A, Color.DARK_RED);
AddCloud(if !ColorFill then na else if A>=40 and A< 50 then B else na, A, Color.DARK_RED);

plot "80" = if last then na else 80;
plot "20" = if last then na else 20;
"80".SetDefaultColor(Color.GRAY);
"20".SetDefaultColor(Color.GRAY);
"80".SetStyle(Curve.MEDIUM_DASH);
"20".SetStyle(Curve.MEDIUM_DASH);
#-- Crosses
def cross = showCrosses and crosses(rsi,trigger);

plot CrossPoint = if cross then rsi else na;
CrossPoint.SetPaintingStrategy(PaintingStrategy.POINTS);
CrossPoint.AssignValueColor(CreateColor(255 - rsi * 2.0, rsi * 2.55, 0));
CrossPoint.SetLineWeight(3);

AssignPriceColor(if !colorBars then Color.CURRENT else
                 CreateColor(255 - rsi * 2.0, rsi * 2.55, 0));
#-- END of CPDE
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Good Day
Looking for TradingView Rainbow Adaptive RSI.
I could not locate this in the forum, and before i ask, has anyone already done the script for T or S?
Thank you
 
Last edited by a moderator:
Great conversion ...
It looks like whenever the indicator does a 2nd crossing, the move is much larger, especially for crossing the overbought and oversold level the 2nd time ...
Is it possible to add a selection input for signal generation during the 2nd crossing?
 
Hello. Did I do something wrong? I clicked the link provided and it didnt show anything. Reads "page not found". Thank you

Scroll up. It is the top post: post#1 of this thread
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
304 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top