RSI Crosses For ThinkOrSwim

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

https://www.tradingview.com/v/G9o94fZN/

//@version=5
indicator('scalper', overlay=true)
AcilCikis = input(false, 'Stop ?')
RSIlong = input(35, 'RSI Long Point')
RSIclose = input(75, 'RSI Short Point')
AcilCikisNoktasi = input(10, 'RSI Stop Point')
rsi = ta.rsi(close, 14)
long = ta.crossover(rsi, RSIlong)
longclose = ta.crossunder(rsi, RSIclose)
stop = ta.crossunder(rsi, AcilCikisNoktasi)

plotshape(long, title='AL', text='✔', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(longclose or stop and AcilCikis == true, title='SAT', text='!', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)
this is a simple RSI crosses
try the below

CSS:
# RSI Crosses
input length = 14;
input signalType = {Long, Short,default Both};
input OverboughtThreshold = 75;
input OversoldThreshold = 25;
input averageType = AverageType.WILDERS;

def Long = signalType!=signalType.Short;
def Short = signalType!=signalType.Long;
def myRSI = RSI(length=length, averageType=averageType).RSI;
def CrossUp = Long  and crosses(myRSI, OversoldThreshold, CrossingDirection.ABOVE);
def CrossDn = Short and Crosses(myRSI, OverboughtThreshold, CrossingDirection.BELOW);

plot SigUp = CrossUp;
plot SigDn = CrossDn;

SigUp.SetDefaultColor(Color.CYAN);
SigDn.SetDefaultColor(Color.MAGENTA);

SigUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SigDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

#-- END of CODE
 
this is a simple RSI crosses
try the below

CSS:
# RSI Crosses
input length = 14;
input signalType = {Long, Short,default Both};
input OverboughtThreshold = 75;
input OversoldThreshold = 25;
input averageType = AverageType.WILDERS;

def Long = signalType!=signalType.Short;
def Short = signalType!=signalType.Long;
def myRSI = RSI(length=length, averageType=averageType).RSI;
def CrossUp = Long  and crosses(myRSI, OversoldThreshold, CrossingDirection.ABOVE);
def CrossDn = Short and Crosses(myRSI, OverboughtThreshold, CrossingDirection.BELOW);

plot SigUp = CrossUp;
plot SigDn = CrossDn;

SigUp.SetDefaultColor(Color.CYAN);
SigDn.SetDefaultColor(Color.MAGENTA);

SigUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SigDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

#-- END of CODE
@samer800 thank you some much!!
 
this is a simple RSI crosses
try the below

CSS:
# RSI Crosses
input length = 14;
input signalType = {Long, Short,default Both};
input OverboughtThreshold = 75;
input OversoldThreshold = 25;
input averageType = AverageType.WILDERS;

def Long = signalType!=signalType.Short;
def Short = signalType!=signalType.Long;
def myRSI = RSI(length=length, averageType=averageType).RSI;
def CrossUp = Long  and crosses(myRSI, OversoldThreshold, CrossingDirection.ABOVE);
def CrossDn = Short and Crosses(myRSI, OverboughtThreshold, CrossingDirection.BELOW);

plot SigUp = CrossUp;
plot SigDn = CrossDn;

SigUp.SetDefaultColor(Color.CYAN);
SigDn.SetDefaultColor(Color.MAGENTA);

SigUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SigDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

#-- END of CODE
@samer800 one favor when you get a change! do you think it is possible to add a MTF labels? that will be nice, to set the chart on 1 minutes but seen the 3-5-15-30 minutes etc etc. thank you in advance. if the labels is not possible just the MTF.
 
Last edited:
@samer800 one favor when you get a change! do you think it is possible to add a MTF labels? that will be nice, to set the chart on 1 minutes but seen the 3-5-15-30 minutes etc etc. thank you in advance. if the labels is not possible just the MTF.
try this.

CSS:
# RSI Crosses
# MTFSrc option - sam4Cok@samer800    - request from UseThinkScript.com member

input showTimeLabel = yes;
input timeframe = {Default "Chart", "Custom"};
input customTimeframe = AggregationPeriod.FIFTEEN_MIN;
input source = FundamentalType.CLOSE;
input length = 14;
input signalType = {Long, Short,default Both};
input OverboughtThreshold = 75;
input OversoldThreshold = 25;
input averageType = AverageType.WILDERS;

def na = Double.NaN;
def current = GetAggregationPeriod();
def tfSrc  = Fundamental(source);
def mtfSrc = Fundamental(FundamentalType = source, Period = customTimeframe);
def src;def mtf;
Switch (timeframe) {
Case "Custom" : src = mtfSrc;
                mtf = customTimeframe;
Default       : src = tfSrc;
                mtf = current;
}
def intra = mtf < AggregationPeriod.DAY;
AddLabel(showTimeLabel and intra, mtf / 1000 / 60 + " M", Color.WHITE);
AddLabel(showTimeLabel and !intra, mtf / AggregationPeriod.DAY + " D", Color.WHITE);

def Long = signalType!=signalType.Short;
def Short = signalType!=signalType.Long;
def myRSI = RSI(Price = src, length = length, averageType = averageType).RSI;
def CrossUp = Long  and crosses(myRSI, OversoldThreshold, CrossingDirection.ABOVE);
def CrossDn = Short and Crosses(myRSI, OverboughtThreshold, CrossingDirection.BELOW);

plot SigUp = if CrossUp and !CrossUp[1] then low else na;
plot SigDn = if CrossDn and !CrossDn[1] then high else na;

SigUp.SetDefaultColor(Color.CYAN);
SigDn.SetDefaultColor(Color.MAGENTA);
SigUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
SigDn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

#-- END of CODE
 
try this.

CSS:
# RSI Crosses
# MTFSrc option - sam4Cok@samer800    - request from UseThinkScript.com member

input showTimeLabel = yes;
input timeframe = {Default "Chart", "Custom"};
input customTimeframe = AggregationPeriod.FIFTEEN_MIN;
input source = FundamentalType.CLOSE;
input length = 14;
input signalType = {Long, Short,default Both};
input OverboughtThreshold = 75;
input OversoldThreshold = 25;
input averageType = AverageType.WILDERS;

def na = Double.NaN;
def current = GetAggregationPeriod();
def tfSrc  = Fundamental(source);
def mtfSrc = Fundamental(FundamentalType = source, Period = customTimeframe);
def src;def mtf;
Switch (timeframe) {
Case "Custom" : src = mtfSrc;
                mtf = customTimeframe;
Default       : src = tfSrc;
                mtf = current;
}
def intra = mtf < AggregationPeriod.DAY;
AddLabel(showTimeLabel and intra, mtf / 1000 / 60 + " M", Color.WHITE);
AddLabel(showTimeLabel and !intra, mtf / AggregationPeriod.DAY + " D", Color.WHITE);

def Long = signalType!=signalType.Short;
def Short = signalType!=signalType.Long;
def myRSI = RSI(Price = src, length = length, averageType = averageType).RSI;
def CrossUp = Long  and crosses(myRSI, OversoldThreshold, CrossingDirection.ABOVE);
def CrossDn = Short and Crosses(myRSI, OverboughtThreshold, CrossingDirection.BELOW);

plot SigUp = if CrossUp and !CrossUp[1] then low else na;
plot SigDn = if CrossDn and !CrossDn[1] then high else na;

SigUp.SetDefaultColor(Color.CYAN);
SigDn.SetDefaultColor(Color.MAGENTA);
SigUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
SigDn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

#-- END of CODE
@samer800 like always great job! thank you some much!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
404 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