Free crypto trend indicator: the SMMA 15/29 Pine Script

The free SMMA 15/29 crypto trend indicator is a Pine Script you can add to any TradingView chart. Copy it below. It's open source (MPL-2.0), with no signup and no black box: the same indicator that powers the Crypto Trend Index and our daily trend-flip scan.

What it does

The script plots two smoothed moving averages on your chart: a fast SMMA 15 and a slow SMMA 29. When the fast line is above the slow line the trend is up and the lines turn green; below means down and red. Two helper averages (19 and 25) mark the transition zone in gray, so you don't read a flip into every wobble.

The script

smma-15-29.pine · MPL-2.0
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © squarito_analytics
//@version=6
indicator(title="Trend smma-15-29", shorttitle="Trend smma-15-29", overlay=true)

smma(src, length) =>
    s = 0.0
    s := na(s[1]) ? ta.sma(src, length) : (s[1] * (length - 1) + src) / length
    s

v1 = smma(close, 15)
v2 = smma(close, 29)

m1 = smma(close, 19)
m2 = smma(close, 25)

p2 = (v1 < m1) != (v1 < v2) or (m2 < v2) != (v1 < v2)
p3 = not p2 and v1 < v2
p1 = not p2 and not p3
c = p1 ? color.green : p2 ? color.silver : color.red

line1 = plot(v1, "Line m15", color=c, linewidth=2)
line2 = plot(v2, "Line m29", color=c, linewidth=2)
fill(line1, line2, color=c)

Licensed under the Mozilla Public License 2.0: free to use, modify, and share.

How to add it to TradingView

  1. Open a chart on TradingView and click Pine Editor in the bottom panel.
  2. Select all in the editor, paste the script, and click Add to chart.
  3. Optional: Save it to "My Scripts" so it's one click away next time.

This runs on one chart at a time

Want the same signal across the top 5000 crypto assets, with an email the moment any coin flips? Create a free account.

  • Daily smma-15-29 scan across the top 5000 coins
  • Email alerts when a trend flips
  • Watchlists and portfolios

Frequently asked questions

Is this crypto trend indicator free?

Yes. The SMMA 15/29 Pine Script is free and open source under the Mozilla Public License 2.0. Copy it from this page and add it to any TradingView chart. No account needed.

How do I add the SMMA 15/29 indicator to TradingView?

Open any chart on TradingView, click Pine Editor at the bottom, paste the script, and click Add to chart. Optionally save it to My Scripts for reuse.

What is the smma-15-29 indicator?

Two smoothed moving averages: a fast SMMA 15 and a slow SMMA 29. When the fast line is above the slow line the trend is up; below means down. The lines are colored green, red, or gray accordingly.

Can I run this across all coins at once?

Not in TradingView: a Pine Script runs on one chart at a time. Squarito runs the same signal across the top 5000 crypto assets daily and emails you when a coin's trend flips. A free account unlocks that.

The script is provided as-is under MPL-2.0. Open code is the point; see how that compares to paywalled trend indicators. This page is for informational purposes only and is not financial advice.