How-to
How to Use thinkScript for Indicators: A Beginner Guide
Last Updated: November 18, 2026
Quick Summary
How to use thinkScript for indicators means writing short scripts in the studies editor that tell your chart what to plot. Start with a simple line, such as a moving average of closing prices, then check the code, apply it, and compare the output with the price bars.
- Open the studies editor from your chart's study menu to write and apply code.
- Start with a simple line, such as a moving average of closing prices.
- Check the script for errors and fix any red warnings before applying it.
- Compare the plotted output with values you calculated by hand.
- Change one input at a time and watch how the line responds.
Table of Contents
- What thinkScript Is and How the Studies Editor Works
- Step-by-Step thinkScript Tutorial: Write, Check and Apply an Indicator
- Finding Free ThinkOrSwim Scripts and an Indicators List to Practise With
- Frequently Asked Questions
What thinkScript Is and How the Studies Editor Works
How to use thinkScript for indicators starts with one simple idea: thinkScript is the language that tells a chart what to draw. Bulls and Bears gives beginners a risk-free place to learn it.
thinkScript is the scripting language used inside thinkorswim-style platforms. A script reads price and volume data, then plots lines, shapes, or signals on your chart. You do not need a finance degree to start, just patience and a willingness to test.
The studies editor is where you write and apply your code. Open it from the chart's study menu, paste or type your script, and check it before you apply it.
Watch out: a script can compile without showing what you expected. Always compare the plotted output with the values you calculated by hand.
Step-by-Step thinkScript Tutorial: Write, Check and Apply an Indicator
Follow these steps to build your first indicator:

- Open the studies editor from your chart.
- Start with a simple line, such as a moving average of closing prices.
- Check the script for errors, then fix any red warnings.
- Apply the indicator and compare it with the price bars.
- Change one input at a time and watch how the line responds.
Keep your first script short. A five-line study teaches more than a long script you cannot read.
We recommend saving each working version, so you can roll back when a change breaks the chart.
The tutorial breaks the process into five steps, each with a clear action to take on the chart.
| Step | What to do | Note |
|---|---|---|
| 1 | Open the studies editor from your chart | Found in the chart's study menu |
| 2 | Start with a simple line, such as a moving average | Use closing prices |
| 3 | Check the script and fix any red warnings | Do this before applying |
| 4 | Apply the indicator and compare it with price bars | Look for matching behaviour |
| 5 | Change one input at a time | Watch how the line responds |
Finding Free ThinkOrSwim Scripts and an Indicators List to Practise With
Bulls and Bears includes 26 community-loved indicators you can study, annotate, and customize, with links back to the original thinkscript.com threads.
Frequently Asked Questions
What can you do with thinkScript?
thinkScript is a scripting language for writing custom studies and indicators. You can plot moving averages or momentum readings on a chart, and review how an idea would have displayed on past bars. Because it is a learning environment, you can practise all of this without placing any trades.
How do I add an indicator on ThinkorSwim?
You can paste your own thinkScript code into the studies editor and apply it to a chart. You can change its inputs to see how the indicator responds.
Can I use a thinkScript indicator to backtest a strategy?
You can view how an indicator plots against historical bars, scrolling back through past candles to check whether its signals appeared where you expected. Treat any signal as a starting point for analysis rather than a guaranteed result, and verify community scripts before relying on them.