Skip to main content

Dynamic RSI Indicator for ThinkOrSwim (Free Download)

IndicatorFreeIntermediate48 min video225 lines of codeNov 3, 2019Updated Oct 21, 2026

A free Dynamic RSI for ThinkOrSwim: the RSI with Bollinger Bands, a yellow average, squeeze dots and automatic trend lines, as upper and lower studies.

Dynamic RSI on a crude oil futures (/CL) chart in ThinkOrSwim
On this page

Overview

In this tutorial I build a Dynamic RSI indicator for ThinkOrSwim from code that one of our members, Keith, sent us. His RSI had a lot of lines on it. In the video we turn what he looks for into rules the code checks on every bar: Bollinger Bands on the RSI, a slower yellow average line, squeeze dots and automatic trend lines.

The free download has two studies. The upper study puts arrows, squeeze dots and overbought and oversold bubbles on your price chart. The lower study shows the RSI with all its lines and the trend line bubbles. It is for traders who already use the RSI and want fewer, clearer signals from it, and it includes Keith's cheat sheet of 5 trade entries.

Key Takeaways

  • The Dynamic RSI is a free ThinkOrSwim indicator that adds Bollinger Bands (14 bars, 2 standard deviations) and a yellow 14-bar average line to a 14-period RSI.
  • A bullish arrow needs the RSI at or below its lower band, the lower band at or below 45, and the RSI at or below 30. A bearish arrow needs the RSI at or above the upper band, the upper band at or above 55, and the RSI at or above 70.
  • Chart bubbles mark the bar where the yellow average crosses above 70 or below 30 (Enter Super Overbought or Oversold) and the bar where it crosses back (Exit).
  • Red squeeze dots print when the upper and lower bands on the RSI are 10 points or less apart.
  • The lower study draws automatic trend lines on the RSI over the last 150, 80 and 40 bars, adapted from trend line code by Mobius, with Long and Short bubbles on the 80-bar lines.

What Is the Dynamic RSI?

The Dynamic RSI is an RSI indicator for ThinkOrSwim with three layers on top: Bollinger Bands, a slower yellow average and automatic trend lines. Keith built the first version, and in Episode 10 of our How to thinkScript series I turned his chart notes into code.

The RSI (Relative Strength Index) is a momentum oscillator that J. Welles Wilder introduced in his 1978 book, New Concepts in Technical Trading Systems, the same book behind our Wilder's Momentum Concept indicator. It compares the average gain with the average loss over 14 bars by default and plots the result from 0 to 100. Readings above 70 are usually called overbought and below 30 oversold.

A standard RSI gives you one line and two fixed levels. The Dynamic RSI tracks four relationships on every bar, and each one shows up in a different place:

RelationshipWhat marks itWhere you see it
RSI vs its Bollinger BandsUp and down arrowsUpper study, on the candles
Yellow average vs 70 and 30Enter and Exit Super Overbought and Oversold bubblesUpper study, at the close
Upper band vs lower bandRed squeeze dotsBoth studies: at the close and on the 50 line
RSI vs automatic trend linesLong and Short bubbles on the 80-bar linesLower study

The Patterns Keith Found on His Charts

The Dynamic RSI started as charts Keith marked up and emailed to us. Before writing any code, I pulled out the patterns he kept coming back to:

  • Trend lines on the RSI. Keith bought bounces off RSI trend line support and watched for breaks. Lines drawn by hand are subjective, so the indicator draws them for you.
  • Retests. More often than not, Keith says, the RSI comes back to retest a trend line it broke. The retest is the conservative entry.
  • Band breaks. On his charts, RSI breaks above the upper band came before moves lower, and breaks below the lower band before moves higher. One of his notes says to cover a short when the RSI hits the lower band or turns back above the middle line.
  • The yellow average. It is far slower than the RSI, so a cross into overbought or oversold shows emphasis behind the move.
  • Timeframes. For scalping, Keith found a 4-minute chart a little cleaner than a 5-minute chart.

Keith also uses the Dynamic RSI to add confidence to Volatility Box trades and to find extra scalps when the market chops sideways.

How to Add the Dynamic RSI to ThinkOrSwim

The Dynamic RSI download installs as two separate studies:

  1. Download the zip from this page. Inside are two study files, TI_DynamicRSI_LowerSTUDY.ts and TI_DynamicRSI_UpperSTUDY.ts, and Keith's Dynamic RSI Cheat Sheet as a PDF.
  2. Import both .ts files as studies. Our guide on how to import a study into ThinkOrSwim walks through each click.
  3. Add both studies to the same chart. The lower study opens in its own panel with the RSI, yellow average, bands, trend lines and red and green shading beyond 70 and 30. The upper study plots its arrows, bubbles and dots on the candles.
  4. To build them by hand, click the Studies icon, choose Create, paste in the code from the Code tab and name the study. I used TI_DynamicRSI_Upper and TI_DynamicRSI_Lower.
  5. Scroll to the right edge of the chart to see the trend lines. Each one covers only the most recent 150, 80 or 40 bars.

In the upper study every plot of Keith's code became a def, which is calculated but never drawn. ThinkOrSwim needs at least one plot in a study, so the error "at least one plot should be defined" showed up in the video until the arrows went in.

Dynamic RSI Settings

The Dynamic RSI has the same inputs in both studies, plus 3 trend line lengths in the lower study. These are the defaults in the download:

InputDefaultWhat it does
length14Bars in the RSI line. The arrows read this RSI too.
over_Bought / over_Sold70 / 30Levels for the Enter and Exit bubbles and the lower panel's lines and RSI colors.
price / averageTypeclose / WILDERSThe price the RSI line reads and the average inside it.
showBreakoutSignalsnoLower study: yes shows arrows when the RSI crosses back above 30 or below 70.
Volatility_Band14Bars in the yellow average and the bands. A comment in the code suggests 20 to 40.
STDEV_Multiplier2Standard deviations between the yellow average and each band.
RSI_Period14Length of the RSI the yellow average and bands are built from. A comment suggests 8 to 25.
RSI_Price / RSI_Price_Line0 / 2Left over from Keith's code. No plot uses them.
TrendLineLength1 / 2 / 3150 / 80 / 40Lower study: bars behind the long, medium and short trend lines.

The plotted RSI uses length and the bands use RSI_Period. Both default to 14, so they describe the same RSI. If you change one, change the other, or the RSI will be measured against bands built from a different RSI.

How the Dynamic RSI Code Works

The Dynamic RSI code starts from Keith's copy of the RSI and adds one block for each relationship. Here is each piece, with the reasoning from the video.

Step 1: The RSI Line

This step’s code is free with an account. Create one or sign in.

NetChgAvg and TotChgAvg average the change and its size over 14 bars. The last line works out to 100 times the average gain over the average gain plus the average loss: the standard RSI.

Step 2: The Yellow Average and the Bands

This step’s code is free with an account. Create one or sign in.

DYNAverage is the yellow line, a 14-bar simple average of the built-in RSI. The bands sit 2 standard deviations of the RSI above and below it.

Those are Bollinger Bands built on the RSI instead of price, so they widen when the RSI swings hard and tighten when it is quiet. Our Bollinger Bands Reversal indicator works with the bands on price.

Step 3: Bullish and Bearish Arrows (Upper Study)

My first version of the arrows only compared the RSI with its bands. That filled the chart with arrows, and you end up guessing which ones to take. Two more filters on each side cut the signals drastically:

This step’s code is free with an account. Create one or sign in.

For a bullish arrow the lower band has to sit at 45 or lower, below the 50 midline, and the RSI has to be oversold. The bearish arrow mirrors it with 55 and 70.

Step 4: Super Overbought and Super Oversold Bubbles

The yellow average is slow, so a cross of 70 or 30 has weight behind it. Keith's point was that knowing when the average leaves overbought matters as much as knowing when it arrives.

This step’s code is free with an account. Create one or sign in.

I think of it as a train coming into a station and leaving it. !superOverbought[1] keeps each bubble to the first bar of the cross. Entry bubbles are light red and light green, exit bubbles red and green, all at the close.

Step 5: Squeeze Dots

This step’s code is free with an account. Create one or sign in.

A squeeze on the Dynamic RSI means the two bands have pinched to 10 points apart or less. I picked 10 as a clean, arbitrary number: on the RSI charts I studied, 10 marked compression more often than not.

The dots are red, at the close on the price chart and on the 50 line in the lower panel. They don't give a direction. The idea in the video is that dots near other signals can hint at which way the move may fire, and confirming with another squeeze, such as our Multi-Timeframe Squeeze indicator, may add confidence.

Step 6: Automatic Trend Lines (Lower Study)

Trend lines were the most challenging part to make objective. We adapted automatic trend line code that Mobius, a well-known thinkScript coder, shared on a forum (the link is in the code). His version drew lines on price. Ours feeds it the RSI.

This step’s code is free with an account. Create one or sign in.

InertiaAll fits a straight regression line through the RSI over the last 80 bars. TL_Bull2 and TL_Bear2 shift it down and up by 80% of the RSI's largest distance from it, which gives a support line and a resistance line.

The code repeats this over 150 bars (the widest, most conservative lines, in white) and 40 bars. The 80-bar and 40-bar lines are light green when they slope up and magenta or pink when they slope down.

Step 7: Long and Short Trend Line Bubbles

This step’s code is free with an account. Create one or sign in.

A red Short bubble prints on TrendLine2A on the first bar the RSI is at or above it. A green Long bubble prints on TrendLine2B on the first bar the RSI is at or below it.

The variable names are the reverse of the labels, and the labels are what you see. The idea from the video: a bounce into resistance is a chance to short, and a bounce into support a chance to buy. I swapped the labels on camera, and the download, version 1.1 from November 6, 2019, fixed the lower study's bubble code, so where the two differ, use the download.

Examples From the Video

The Dynamic RSI examples in the video come from 4-minute charts, the timeframe Keith suggested. These are the moments I walked through, read in hindsight:

  • Gold. The first arrow after the filters went in lined up with an entry near the Volatility Box, in the first hour, when we don't usually trade gold. Squeezes on the chart came with sideways chop, then a thrust higher or a sharp drop.
  • The S&P, about 5 days of data. After an Exit Super Overbought bubble, price fell, came back up to retest, tested a third time and then broke lower. A bearish arrow led to a flush lower that ran out of steam at the Volatility Box. One squeeze didn't pan out.
  • The S&P, overnight. A bullish arrow fired as price fell into the Volatility Box, followed by a cup and handle reversal. Waiting for the Enter Super Oversold bubble would have given a better entry.
  • Crude oil futures. After an Exit Super Overbought bubble, price dropped hard, and an Enter Super Oversold bubble followed. Our usual entry before that was stopped out. A conservative trader who waited for oversold, with the outer edge of the Volatility Box as the stop, got a strong follow-through.

These examples show what each signal looks like on a chart. They don't measure how often the signals work, and the video doesn't include a backtest.

Keith's 5 Trade Entries

Keith's Dynamic RSI Cheat Sheet is a PDF in the download. The cheat sheet shows a marked-up chart for each of his 5 trade entries:

EntryWhat to look forExit in the cheat sheet
1A break of a trend line. His chart marks each break and test.Not given
2The yellow average line crossing 50When the RSI crosses the average line
3The yellow average in overbought or oversold territory, where Keith looks for a reversalNot given
4The RSI breaking through the Bollinger BandsNot given
5The RSI touching two trend lines at once, a major support or resistance levelWhen the RSI touches a band or crosses below the average line

Entries 2 and 5 are not marked by any arrow or bubble, so you read them off the lower panel.

How I Use the Dynamic RSI

The Dynamic RSI is a filter on price levels you already trust. In the video I layered it on Volatility Box levels, and you can do the same with moving averages or any level where you expect price to run out of steam.

The number of filters you use is a matter of style: an aggressive trader might drop one to see more signals, and a conservative trader might add more. Build a plan around the signals you pick.

Decide where your stop goes before you enter, as with the outer edge of the box in the crude oil example, and size the trade so a stop-out costs a small, fixed share of your account. Check the clock too: one bullish arrow in the video came near noon Pacific, with 1 hour left in the session.

Ways to Customize the Dynamic RSI

The Dynamic RSI keeps a few settings in the code instead of the inputs:

  • Squeeze width. The 10 in the BBDistance line is hard-coded. A smaller number means tighter squeezes and fewer dots.
  • Arrow levels. The 45 and 55 band filters and the 30 and 70 RSI levels are typed into the arrow lines, so the over_Bought and over_Sold inputs don't change them.
  • More trend line bubbles. Copy the two trendLineSignal lines and the two bubble lines, give the copied signals new names, and change 2A and 2B to 1A and 1B for the 150-bar lines or 3A and 3B for the 40-bar lines.

If an edit throws an error, our guide on how to fix bugs in thinkScript code shows how to track it down. For another way to pair the RSI with a second reading, our Rate of Change indicator plots an arrow only when the ROC turns in an extreme zone on the same bar as an RSI breakout signal.

Dynamic RSI on real charts

Drawn from real daily bars with the code on this page, through Oct 20, 2026. These are the upper study's arrows: a green arrow when the RSI is at or under 30, at or under the lower Bollinger Band drawn on the RSI, and that band is at or under 45. The red arrow is the mirror image above 70. The lower panel shows the RSI, its yellow 14-bar average and the bands. I picked the most recent green arrow on a well-known name that was higher 10 trading days later, and the most recent that was not.

NKE, Oct 2, 2026: an oversold arrow that bounced

Dynamic RSI on a NKE daily chart in ThinkOrSwim: a green arrow on Oct 2, 2026 with the RSI under 30 and under its lower band
NKE on Oct 2, 2026: RSI 28.2, below its lower band.

NKE closed at $33.87 on the arrow and at $37.13 ten trading days later, +9.6%.

XLRE, Sep 24, 2026: oversold got more oversold

Dynamic RSI on a XLRE daily chart in ThinkOrSwim: a green arrow on Sep 24, 2026 that did not follow through
XLRE on Sep 24, 2026: RSI 24.9.

XLRE closed at $41.66 on the arrow and at $40.84 ten trading days later, -2.0%.

By the numbers

1,435Green arrows
57.3%Green arrows higher 10 days later
52.7%Any day higher 10 days later
2,095Red arrows

Daily bars for 648 stocks and ETFs through Oct 20, 2026: most stocks from July 2024, the 14 ETFs from 2016. The first arrow of each run, against every day in the same symbols over the same bars. Red arrows were followed by a lower close 10 days later 47.4% of the time. The lower study's automatic trend lines are left out here: they are fitted to all the bars on the chart, so they move as new bars arrive.

Full thinkScript code

Dynamic RSI.tsthinkScript · 225 lines
The full code is free with an account

Create a free account or sign in to copy all 225 lines and download the file.

Download

Dynamic RSI Indicator

Download the Dynamic RSI indicator for ThinkOrSwim. The download is a .zip with 3 files: TI_DynamicRSI_LowerSTUDY.ts (the lower study with the RSI, bands, squeeze dots and automatic trend lines), TI_DynamicRSI_UpperSTUDY.ts (arrows, squeeze dots and overbought and oversold bubbles on the price chart) and Keith's Dynamic RSI Cheat Sheet, a PDF with his 5 trade entries. Import each .ts file as its own study. If you haven't added a custom study before, here's how to import an indicator into your ThinkOrSwim platform.

Download free

Video: Dynamic RSI, built line by line

48 minutes on YouTube.

Watch on YouTube

Questions

What is the Dynamic RSI indicator?

The Dynamic RSI is a free ThinkOrSwim indicator built from code by one of our members, Keith. It adds Bollinger Bands and a slower yellow average line to a 14-period RSI, plus squeeze dots and automatic trend lines. Arrows and bubbles mark band breaks, overbought and oversold crosses of the average, and trend line touches.

How is the Dynamic RSI different from the standard RSI?

A standard RSI compares its line with fixed levels at 70 and 30. The Dynamic RSI keeps those levels and adds Bollinger Bands built from the RSI itself, so a reading is also judged against how much the RSI has been swinging. It also adds a slower yellow average, squeeze dots and trend lines drawn on the RSI.

How do I add the Dynamic RSI to ThinkOrSwim?

Download the zip and import TI_DynamicRSI_LowerSTUDY.ts and TI_DynamicRSI_UpperSTUDY.ts as two separate studies. Add both to the same chart: the lower study opens in its own panel and the upper study plots on the price candles. You can also create each study by hand and paste in its code from the Code tab.

What do the arrows on the Dynamic RSI mean?

The arrows come from the upper study. An up arrow needs the RSI at or below its lower Bollinger Band, the lower band at or below 45 and the RSI at or below 30. A down arrow needs the RSI at or above the upper band, the upper band at or above 55 and the RSI at or above 70.

What does Enter Super Overbought mean?

Enter Super Overbought marks the bar where the yellow average line, a 14-bar average of the RSI, crosses above 70. Exit Super Overbought marks the bar where it crosses back below 70, and the oversold bubbles do the same around 30. Because the average is slow, these crosses show emphasis in a move.

What do the red dots on the Dynamic RSI mean?

The red dots are squeeze dots. They print when the upper and lower Bollinger Bands on the RSI are 10 points or less apart. On the price chart they sit at the close, and in the lower panel on the 50 line. In the video, price often chopped sideways during the dots and then moved sharply.

How does the Dynamic RSI draw trend lines automatically?

The lower study adapts automatic trend line code by Mobius to the RSI. Over the last 150, 80 and 40 bars, it fits a regression line through the RSI and shifts it up and down by 80% of the RSI's largest distance from it. Long and Short bubbles mark the RSI reaching the 80-bar lines.

What timeframe works best with the Dynamic RSI?

Keith found a 4-minute chart a little cleaner than a 5-minute chart for scalping, and I used 4-minute charts in the video. The RSI gets less choppy as the timeframe gets longer, but for a day trader that's a trade-off. The code runs on any timeframe, so test it on the one you trade before relying on it.

Get each new indicator by email

One email on Sundays with the week's new tool and its code. A free account also unlocks every .txt download.

No credit card. Unsubscribe anytime.