indicator · own pane · open source
Market Trend Strength indicator
Market Trend Strength is a free open-source indicator. Market Trend Strength measures how often consecutive bars move the same direction over a… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Market Trend Strength does
Market Trend Strength measures how often consecutive bars move the same direction over a window, as a percentage. Above 50 = persistence, below = chop.
- Values above ~60 = strong trend persistence; below ~40 = the market keeps flipping on itself.
- Use to filter mean-reversion vs trend-following strategies.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Market Trend Strength", overlay=false)
len = input.int(14, "Length", minval=2, maxval=200)
colorUp = input.color("color.green", "Color Up")
colorDown = input.color("color.red", "Color Down")
colorNeutral = input.color("color.gray", "Color Neutral")
mts = math.sum((math.sign(ta.change(close)) == math.sign(ta.change(close)[1]) ? 1 : 0), len) / len * 100
hline(50, "Persistence floor", color=colorNeutral, linestyle=hline.style_dashed)
p_MTS = plot(mts, "MTS", color=mts >= 50 ? colorUp : colorDown, linewidth=2)
alertcondition(ta.crossover(mts, 60), "MTS enters trending", "Market Trend Strength crossed above 60")
alertcondition(ta.crossunder(mts, 40), "MTS enters chop", "Market Trend Strength dropped below 40")
No comments yet.
Sign in to comment.