
Table of Contents
Unlock Smarter Trading: Get Our FREE Advanced Moving Average Indicator for ThinkorSwim
Are you tired of manually tracking trend changes, missing golden cross opportunities, or struggling to spot high-probability pullbacks?
Weβve built a powerful, free ThinkorSwim indicator that does the heavy lifting for you combining multi-timeframe moving averages, trend direction analysis, Golden & Death Cross alerts, and smart pullback detection all in one clean, easy-to-use script.
And the best part?
π Itβs 100% FREE. No signup. No trial. No hidden fees.
π§ What This Free Indicator Does
Our Advanced Moving Average with Trend Signals & Pullback Detection is designed for active traders who want clarity, precision, and real-time alerts β without cluttering their charts.
β Key Features:
Feature | Benefit |
---|---|
4 Customizable MAs (9, 21, 50, 200) | See short-, mid-, and long-term trends at a glance |
Multiple MA Types (SMA, EMA, Hull) | Choose what works best for your strategy |
Golden & Death Cross Alerts | Get notified when major trend shifts occur |
Trend Strength Label | Instantly identify Strong Uptrends, Downtrends, or Neutral zones |
Pullback Zone Detection | Spot potential reversal entries during strong trends |
Real-Time Sound Alerts | Never miss a signal β even when you're not watching the screen |
Clean, Professional Look | Hardcoded colors ensure compatibility and readability |
π How It Works: Built for Precision & Simplicity
This indicator uses a multi-layered approach to help you trade with the trend and catch pullbacks like a pro.
πΉ The 4 Moving Averages:
- Fast MA (9-period) β Green line β Short-term momentum
- Mid MA (21-period) β Blue line β Intermediate trend
- Long MA (50-period) β Orange line β Primary trend filter
- Very Long MA (200-period) β Red line β Long-term market bias
When price is above all four MAs β Bullish strength
When price is below all four MAs β Bearish dominance
πΉ Golden Cross & Death Cross Detection
- Golden Cross (Green Up Arrow + Chime): 50 EMA crosses above 200 EMA β Bullish signal
- Death Cross (Red Down Arrow + Bell): 50 EMA crosses below 200 EMA β Bearish signal
Perfect for swing traders and investors tracking major market shifts.
πΉ Smart Pullback Zones
The script automatically detects when price pulls back into the 21-period MA zone during a confirmed trend:
- β Uptrend Pullback? Look for yellow up arrow near the blue MA
- β Downtrend Pullback? Watch for pink down arrow
These are ideal spots to consider entries with the trend.
πΉ Dynamic Trend Label
See real-time trend status on your chart:
- π Strong Uptrend β Price well above 200 MA
- π‘ Uptrend β Healthy bullish momentum
- π΄ Strong Downtrend β Price far below 200 MA
- βͺ Neutral β Choppy or transitioning market
Best Time-Frame To Use This Indicator?
You should use this indicator on longer Timeframes I.E (Hour,Daily,Weekly)
π How to Install (Itβs Super Easy)
This ThinkScript is ready to go β just copy and paste!
Step-by-Step Installation:
- Open ThinkorSwim platform
- Go to Charts > Studies > Edit Studies
- Click "Create" and name it
AdvancedMA_TrendSignals
- Paste the full ThinkScript code (provided below)
- Click OK β Apply to chart
β Thatβs it! The indicator will auto-load with default settings.
π‘ Tip: Use on daily or 1-hour charts for best results. Works on stocks, ETFs, futures, and forex.
π Full ThinkScript Code (Free to Use & Share)
# Advanced Moving Average with Trend Signals & Pullback Detection
# Author: NiceBreakout.Com
# ββββββββββββββββ INPUTS ββββββββββββββββ
input fastLength = 9;
input midLength = 21;
input longLength = 50;
input veryLongLength = 200;
input maTypeFast = { default EMA, SMA, Hull };
input maTypeMid = { default EMA, SMA, Hull };
input maTypeLong = { default EMA, SMA };
input showMovingAverages = yes;
input showCrossLabels = yes;
input showPullbackZones = yes;
input showTrendLabel = yes;
input alertGoldenCross = yes;
input alertDeathCross = yes;
input alertPullback = yes;
input alertTrendChange = yes;
# ββββββββββββββββ SOUND INPUTS ββββββββββββββββ
input soundGoldenCross = Sound.Chimes;
input soundDeathCross = Sound.Bell;
input soundPullback = Sound.Ding;
input soundTrendChange = Sound.Chimes;
# ββββββββββββββββ PRICE & MOVING AVERAGES ββββββββββββββββ
def price = close;
# Fast MA (9)
def fastMA;
switch (maTypeFast) {
case EMA:
fastMA = ExpAverage(price, fastLength);
case SMA:
fastMA = Average(price, fastLength);
case Hull:
fastMA = HullMovingAvg(price, fastLength);
}
# Mid MA (21)
def midMA;
switch (maTypeMid) {
case EMA:
midMA = ExpAverage(price, midLength);
case SMA:
midMA = Average(price, midLength);
case Hull:
midMA = HullMovingAvg(price, midLength);
}
# Long MA (50)
def longMA;
switch (maTypeLong) {
case EMA:
longMA = ExpAverage(price, longLength);
case SMA:
longMA = Average(price, longLength);
}
# Very Long MA (200)
def veryLongMA = ExpAverage(price, veryLongLength);
# Plot MAs β Colors hardcoded using valid Color constants
plot pFastMA = if showMovingAverages then fastMA else Double.NaN;
pFastMA.SetDefaultColor(Color.GREEN);
pFastMA.SetLineWeight(2);
pFastMA.HideTitle();
plot pMidMA = if showMovingAverages then midMA else Double.NaN;
pMidMA.SetDefaultColor(Color.BLUE);
pMidMA.SetLineWeight(2);
pMidMA.HideTitle();
plot pLongMA = if showMovingAverages then longMA else Double.NaN;
pLongMA.SetDefaultColor(Color.ORANGE);
pLongMA.SetLineWeight(2);
pLongMA.HideTitle();
plot pVeryLongMA = if showMovingAverages then veryLongMA else Double.NaN;
pVeryLongMA.SetDefaultColor(Color.RED);
pVeryLongMA.SetLineWeight(2);
pVeryLongMA.HideTitle();
# ββββββββββββββββ GOLDEN CROSS / DEATH CROSS ββββββββββββββββ
def goldenCross = Crosses(longMA, veryLongMA, CrossingDirection.ABOVE);
def deathCross = Crosses(longMA, veryLongMA, CrossingDirection.BELOW);
AddLabel(showCrossLabels and goldenCross, "π’ GOLDEN CROSS", Color.UPTICK);
AddLabel(showCrossLabels and deathCross, "π΄ DEATH CROSS", Color.DOWNTICK);
plot gcArrow = if goldenCross then low * 0.995 else Double.NaN;
gcArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
gcArrow.SetLineWeight(3);
gcArrow.SetDefaultColor(Color.CYAN);
gcArrow.HideTitle();
plot dcArrow = if deathCross then high * 1.005 else Double.NaN;
dcArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
dcArrow.SetLineWeight(3);
dcArrow.SetDefaultColor(Color.MAGENTA);
dcArrow.HideTitle();
Alert(alertGoldenCross and goldenCross, "", Alert.BAR, soundGoldenCross);
Alert(alertDeathCross and deathCross, "", Alert.BAR, soundDeathCross);
# ββββββββββββββββ TREND DIRECTION & STRENGTH ββββββββββββββββ
def longSlope = longMA - longMA[1];
def veryLongSlope = veryLongMA - veryLongMA[1];
def aboveAllMA = price > fastMA and price > midMA and price > longMA and price > veryLongMA;
def belowAllMA = price < fastMA and price < midMA and price < longMA and price < veryLongMA;
def uptrend = longMA > veryLongMA and longSlope > 0 and price > longMA;
def downtrend = longMA < veryLongMA and longSlope < 0 and price < longMA;
def trendStrength =
if uptrend and price > veryLongMA * 1.1 then 3
else if uptrend then 2
else if downtrend and price < veryLongMA * 0.9 then -3
else if downtrend then -2
else 0;
AddLabel(showTrendLabel,
"Trend: " +
if trendStrength == 3 then "Strong Uptrend"
else if trendStrength == 2 then "Uptrend"
else if trendStrength == -3 then "Strong Downtrend"
else if trendStrength == -2 then "Downtrend"
else "Neutral",
if trendStrength > 0 then Color.UPTICK
else if trendStrength < 0 then Color.DOWNTICK
else Color.GRAY
);
# Trend change alerts
def trendChangeUp = !aboveAllMA[1] and aboveAllMA;
def trendChangeDown = !belowAllMA[1] and belowAllMA;
Alert(alertTrendChange and trendChangeUp, "Price crossed above all MAs", Alert.BAR, soundTrendChange);
Alert(alertTrendChange and trendChangeDown, "Price crossed below all MAs", Alert.BAR, soundTrendChange);
# ββββββββββββββββ PULLBACK DETECTION (IMPROVED) ββββββββββββββββ
# Only detect pullbacks in a confirmed trend
def inUptrend = uptrend;
def inDowntrend = downtrend;
# Tightened pullback range around 21 MA
def inPullbackUp =
inUptrend and
price >= midMA * 0.98 and
price <= midMA * 1.02 and
price < midMA[1] and
price < fastMA and
price < midMA[1]; # Confirms downward momentum into MA
def inPullbackDown =
inDowntrend and
price <= midMA * 1.02 and
price >= midMA * 0.98 and
price > midMA[1] and
price > fastMA and
price > midMA[1]; # Confirms upward momentum into MA
# Cooldown logic to prevent repeated signals
def pullbackStartUp = inPullbackUp and !inPullbackUp[1];
def pullbackStartDown = inPullbackDown and !inPullbackDown[1];
# Cooldown filters (wait until price exits zone before allowing new signal)
def noRecentUpSignal = !pullbackStartUp[1] and !pullbackStartUp[2];
def noRecentDownSignal = !pullbackStartDown[1] and !pullbackStartDown[2];
def validPullbackUp = pullbackStartUp and noRecentUpSignal;
def validPullbackDown = pullbackStartDown and noRecentDownSignal;
# Pullback Zones (persistent while in zone)
def pullbackZoneUp = if validPullbackUp then 1 else if price > midMA * 1.03 then 0 else pullbackZoneUp[1];
def pullbackZoneDown = if validPullbackDown then 1 else if price < midMA * 0.97 then 0 else pullbackZoneDown[1];
# Arrows only on confirmed, isolated pullback start
plot pullbackUpArrow = if validPullbackUp then low * 0.995 else Double.NaN;
pullbackUpArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
pullbackUpArrow.SetLineWeight(2);
pullbackUpArrow.SetDefaultColor(Color.YELLOW);
pullbackUpArrow.HideTitle();
plot pullbackDownArrow = if validPullbackDown then high * 1.005 else Double.NaN;
pullbackDownArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
pullbackDownArrow.SetLineWeight(2);
pullbackDownArrow.SetDefaultColor(Color.PINK);
pullbackDownArrow.HideTitle();
# βββ ALERTS βββ
Alert(alertPullback and validPullbackUp, "HIGH-QUALITY UPTREND PULLBACK", Alert.BAR, soundPullback);
Alert(alertPullback and validPullbackDown, "HIGH-QUALITY DOWNTREND PULLBACK", Alert.BAR, soundPullback);
β Frequently Asked Questions (FAQ)
Q: Is this indicator really free?
β Yes! This indicator is 100% free to download, use, and share. No email, no registration, no catch.
Q: Best Time-Frame?
We Think the best Time-Frame to use this indicator is on the Daily Time-Frame
Q: Do I need programming skills to install it?
Nope! Just copy and paste the code into ThinkorSwimβs study editor. Takes less than 2 minutes.
Q: Which markets does it work on?
This works on stocks, ETFs, β anywhere you can use ThinkorSwim charts.
Q: Can I customize the colors or alerts?
The colors are hardcoded for compatibility, but you can modify alert types, sounds, and visibility via inputs.
Q: Does it repaint or lag?
No. All signals are based on confirmed price action and moving average crossovers β no repainting.
π Final Thoughts
Whether you're a beginner or a seasoned pro, this Advanced Moving Average Indicator gives you the edge you need to:
- Trade with the trend
- Catch reversals early
- Avoid false breakouts
- Stay disciplined with alerts
All for $0.
So what are you waiting for?
π Copy the code above, install it now, and start trading smarter today.
Tags: #ThinkorSwim #FreeIndicator #MovingAverage #GoldenCross #PullbackTrading #StockMarket #DayTrading #SwingTrading #TechnicalAnalysis #ThinkScript #TradingTools #EMA #HullMA #TrendFollowing
Disclaimer: This indicator is for educational purposes only. Not financial advice. Trading involves risk. Always test strategies in a paper trading account before going live.
Legal Disclaimer
This article is for educational purposes only and does not constitute financial advice or a recommendation to buy or sell any specific securities. Always consult with a licensed financial advisor before making investment decisions. This post may include affiliate links. If you click and purchase, I may receive a small commission at no additional cost to you.

About Daniel M.
Founder of Nice Breakout
founder of Nice Breakout is a seasoned professional with over 5 years of dedicated experience navigating the intricacies of financial markets, particularly utilizing the Thinkorswim platform. His passion lies in empowering traders and investors by providing insightful analysis and cutting-edge tools.