indicator · own pane · open source

Trend Score Composite

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Trend Score Composite — sums the directional sign of the last four close-vs-prev-close deltas and scales to ±100. +100 = four bars of strict higher closes; -100 = four bars of strict lower closes.

  • Filter chop by requiring |score| > 50.
  • Built-in regime read at a glance.

Source code

//@version=5
indicator("Trend Score Composite", overlay=false)
s1 = ta.change(close) > 0 ? 1 : ta.change(close) < 0 ? -1 : 0
s2 = ta.change(close, 1) > 0 ? 1 : ta.change(close, 1) < 0 ? -1 : 0
s3 = ta.change(close, 2) > 0 ? 1 : ta.change(close, 2) < 0 ? -1 : 0
s4 = ta.change(close, 3) > 0 ? 1 : ta.change(close, 3) < 0 ? -1 : 0
score = (s1 + s2 + s3 + s4) / 4 * 100
hline(50, "Bull", color=color.gray)
hline(-50, "Bear", color=color.gray)
p_Trend_Score = plot(score, "Trend Score", color=color.blue, linewidth=2)
alertcondition(ta.crossover(score, 50), "Bullish", "Trend score crossed above +50")
alertcondition(ta.crossunder(score, -50), "Bearish", "Trend score crossed below -50")

Comments

No comments yet.

Sign in to comment.