Automated Trading for ThinkOrSwim
Learn how to set up automated trading in ThinkOrSwim using conditional orders and thinkScript. Copy our ready-to-use scripts to automate entries based on momentum, pullbacks, and technical signals.
3/11/25 - The code snippet for the One-Two Punch Setup has been updated!
Getting Started with ThinkOrSwim Automated Trading
Deploy your first automated trading strategy in ThinkOrSwim with our step-by-step tutorials and ready-to-use thinkScript code.
1 Fundamentals
If you're a beginner, start with this 1-hour deep dive, with practical examples. I'll show you how to build 8 real-world automated trading scripts.
Through real examples, you'll learn the entire process to create an automated trading script in ThinkOrSwim (start to finish).
Examples include:
- Automatically buy pullback in strong trends
- Automatically sell covered calls at Fibonacci levels
- Automatically sell when a squeeze loses momentum
- And more!
Always test automated trading scripts in Paper Money, BEFORE deploying to Live Money!
2 Advanced
In this tutorial, you'll apply the fundamental skills you've learned to turn a full trading setup into a complete automated trading strategy.
You'll learn the exact steps you need to follow, to turn setups into complete automated trading strategies that you can deploy in ThinkOrSwim.
Watch this video for a deep dive into the One Two Punch setup.
Code snippets are available for Volatility Box members
Unlock All ScriptsHow to Use ThinkOrSwim Automated Trading Scripts
Use our pre-written thinkScript code to set up automated trading in ThinkOrSwim. These scripts trigger conditional orders to enter positions automatically.
Choose a Strategy
Start with a high-probability setup you want to trade (examples provided).
Deploy Script
Place automated trading script to buy/sell when rules met.
Monitor Trade
Adjust the exit orders (if necessary), and let the trade manage itself.
ThinkOrSwim Automated Trading Scripts
Copy these ready-to-use thinkScript automated trading scripts. Each includes Bull and Bear code variants for long and short positions.
#1 - Momentum Cross
3 EMA crossing above 8 EMA
#2 - Buy the Dip
Close price is below Market Pulse line
#3 - Candlestick Patterns
Close above the previous candle's high
#4 - Trend Reversals
Market Pulse turns green
#5 - Short When Overbought
Green Edge Signal arrow
#6 - Pullback to 50-SMA
Close below the 50-SMA
Always test automated trading scripts in Paper Money, BEFORE deploying to Live Money!
Momentum Cross
Tools Required
Description
This script leverages the Momentum Cross indicator to automate trading based on the 3 EMA crossing above or below the 8 EMA. It is designed to capture momentum reversals in overbought or oversold stocks.
- Bullish Position: 3 EMA crossing above 8 EMA
- Bearish Position: 3 EMA crossing below 8 EMA
When to Use
Use this script when you've identified overbought or oversold stocks and want to enter positions at the point of momentum reversal.
Practical Example
A stock breaches its Volatility Box models, triggers a green Edge Signal arrow, and the 3 EMA crosses above the 8 EMA. This script can automatically place a limit buy order at the crossover point.
Code snippets are available for Volatility Box members
Unlock All ScriptsBuy the Dip
Tools Required
Description
This script automatically buys the next pullback to the Market Pulse line, helping you capitalize on pullback opportunities in healthy trends, without constant chart monitoring.
- Bullish Position: Close price is below Market Pulse line
- Bearish Position: Close price is above Market Pulse line
When to Use
Use this script in strong bull trends when you want to automate buying pullbacks to the Market Pulse line.
Practical Example
Automatically buying indices such as SPY, QQQ, VOO, or VGT during a pullback to the Market Pulse line in a strong bull trend.
Code snippets are available for Volatility Box members
Unlock All ScriptsCandlestick Patterns
Tools Required
Candlestick pattern recognition
Description
This script automates trading orders using candlestick patterns. It enables automatic entry into positions when the current candle marks a new pivot point.
- Bullish Position: Close above the previous candle's high
- Bearish Position: Close below the previous candle's low
When to Use
Use this script when you want to automate trading based on candlestick pivot patterns within specific support or resistance zones. This script checks the bar prior, to confirm the signal has finished printing.
Practical Example
Automatically buying or selling Google stock (GOOGL or GOOG) whenever the price forms a pivot point inside the daily or hourly Volatility Box model clouds.
Code snippets are available for Volatility Box members
Unlock All ScriptsTrend Reversals
Tools Required
Market Pulse and Momentum Cross indicators
Description
This script automates trading by identifying the end of a strong preceding trend and entering a position when the trend reverses.
- Bullish Position: Market Pulse turns green
- Bearish Position: Market Pulse turns red
When to Use
Use this script when trading volatile stocks with strong morning trends, and you want to automate trend reversal entries when the morning trend exhausts.
Practical Example
Automatically monitoring a volatile stock for the morning trend to establish, and entering a position when the trend reverses, all without requiring manual intervention.
Code snippets are available for Volatility Box members
Unlock All ScriptsShort When Overbought
Tools Required
Description
This script automates swing trading by placing orders based on if we have an overbought/oversold confirmation signal (manually combined with price channels).
- Bullish Position: Green Edge Signal arrow
- Bearish Position: Red Edge Signal arrow
When to Use
Use this script when trading within trend channels and looking to capitalize on overbought conditions at the channel's top, and oversold conditions at the channel's bottom.
Practical Example
Automatically shorting the Nasdaq when it reaches the top of a bearish trend channel and a red Edge Signal arrow appears.
Code snippets are available for Volatility Box members
Unlock All ScriptsPullback to 50-SMA
Tools Required
50-Simple Moving Average and Slingshot Squeeze
Description
This script automates trading for stocks in which you'd like to enter when price pulls back to the 50-period Simple Moving Average.
- Bullish Position: Close below the 50-SMA
- Bearish Position: Close above the 50-SMA
When to Use
Use this script when trading stocks with confirmed Slingshot Squeeze setups and a strong backtest history, focusing on pullbacks to key support levels.
Practical Example
Leverage 20 years of backtest data to identify optimal squeeze setups. Then, use this script to enter positions only when the stock pulls back to the 50-SMA or Market Pulse line.
Code snippets are available for Volatility Box members
Unlock All ScriptsMore Automated Trading Videos
Continue learning with these additional tutorials on automated trading strategies.
Frequently Asked Questions
To set up automated trading in ThinkOrSwim, you create conditional orders using thinkScript code. First, write or copy a thinkScript study that plots a signal (like a moving average crossover). Then, create a conditional order that triggers when that signal appears. ThinkOrSwim will automatically execute the trade when your conditions are met.
Yes, ThinkOrSwim supports automated trading through conditional orders and thinkScript. While it's not full algorithmic trading, ThinkOrSwim automated trading lets you place orders that trigger automatically based on technical conditions like indicator signals, price levels, or pattern recognition.
The best automated trading strategies for ThinkOrSwim are simple, signal-based systems. Popular options include EMA crossover strategies (like the Momentum Cross), pullback entries to moving averages (like the Market Pulse line), and overbought/oversold reversals (using Edge Signals). Start with one strategy and master it before adding complexity.
Yes, you can automate day trading entries in ThinkOrSwim using conditional orders. Create a thinkScript that identifies your entry signal, then set up a conditional order to buy or sell when the signal triggers. Many day traders use ThinkOrSwim automated trading for momentum crossovers, breakout entries, and pullback strategies.
To create automated trading scripts in ThinkOrSwim, use thinkScript to write a study with a "plot signal" output. The script should return 1 (true) when your entry conditions are met. Then attach this script to a conditional order. ThinkOrSwim will monitor the signal and execute automatically when conditions trigger.
Yes, ThinkOrSwim automated trading features are free with any TD Ameritrade/Charles Schwab account. You can create unlimited conditional orders and thinkScript studies at no additional cost. The platform includes all the tools needed for automated trading without subscription fees.
Yes, ThinkOrSwim supports automated options trading through conditional orders. You can automatically sell covered calls at resistance levels, buy protective puts when signals trigger, or enter spreads based on volatility conditions. The same thinkScript automation framework works for stocks, options, and futures.
ThinkOrSwim automated trading has some limitations: orders require the platform to be running, you can't backtest conditional orders directly, and it's semi-automated (you manage exits manually). For full algorithmic trading, you'd need a dedicated algo platform. However, for most retail traders, ThinkOrSwim automated trading provides excellent functionality.
Start Automated Trading in ThinkOrSwim Today
Get access to all thinkScript code snippets and advanced automated trading strategies.