sharp rise in RSI

GroundLoop

New member
Newbie to trading and scripting in TOS here. Is there documentation for the TOS scripting language? I looked but did not see it.

Looking for a way to detect a sharp rise in RSI. Would need to keep track of RSI value for X amount of previous candles to know when there is a sharp rise. Also do the same for volume. Could someone please just get me started. I am a software engineer and can probably figure it out once I see how the syntax works.
 
Solution
here is a lower study to experiment with
pick a quantity of bars and a number for rsi up movement.
draw arrow when true

Code:
#rsi_fastrise

declare lower;

def na = double.nan;
def bn = barnumber();

input rsi_rise_within_bars = 3;
input rsi_rise_min = 8.0;

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

# read RSI data from the study, using most of the parameters
def r = rsi(
 length = length,
 over_Bought = over_Bought,
 over_Sold = over_Sold,
 price = price,
 averageType = averageType);

plot z = r;


# look at prev x bars and find min rsi. start at prev bar
def rmin = lowest(r[1], rsi_rise_within_bars);

# find diff from...

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

@GroundLoop
The standard syntax for momentum (rise) is current bar is greater than third previous bar
The syntax would be:
def rsiMOMO = rsi() > rsi()[3];
def volMOMO = volume > volume[3];
read more:
https://stockcharts.com/articles/dancing/2018/10/momentum--rate-of-change.html#google_vignette

For a SHARP rise, a percentage variable could be added:
def rsiMOMO = rsi() > rsi()[3] *1.3;
def volMOMO = volume > volume[3] *1.3;

To track that sharp rise, use a recursive statement:
def rsiMOMO = rsi() > rsi()[3] *1.3;
def volMOMO = volume > volume[3] *1.3;
def sharpRSI = if rsiMOMO then rsiMOMO else sharpRSI[1];
def sharpRSI = if rsiMOMO then rsiMOMO else sharpRSI[1];
 
here is a lower study to experiment with
pick a quantity of bars and a number for rsi up movement.
draw arrow when true

Code:
#rsi_fastrise

declare lower;

def na = double.nan;
def bn = barnumber();

input rsi_rise_within_bars = 3;
input rsi_rise_min = 8.0;

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

# read RSI data from the study, using most of the parameters
def r = rsi(
 length = length,
 over_Bought = over_Bought,
 over_Sold = over_Sold,
 price = price,
 averageType = averageType);

plot z = r;


# look at prev x bars and find min rsi. start at prev bar
def rmin = lowest(r[1], rsi_rise_within_bars);

# find diff from current rsi to prev lowesr rsi
def rdiff = r - rmin;

# is the rsi diff more than the min ?
def isrise = rdiff >= rsi_rise_min;

plot z1 = if isrise then r*0.99 else na;
z1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z1.SetDefaultColor(Color.cyan);
z1.setlineweight(3);
z1.hidebubble();
#




RSI study
https://toslc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/R-S/RSI
it lists the input parameters. these names are almost the same as the input code line variables in the study. if the parameter has a space in the name, when used as a parameter in code, replace the space with a _.
over bought becomes over_bought

the plots names are the same

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

plots
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;
 
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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