indicator · on price · open source
Pivot Trend Filter indicator
Pivot Trend Filter is a free open-source indicator. Pivot Trend Filter layers a daily standard pivot over a mid-period trend MA and tints the… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Pivot Trend Filter does
Pivot Trend Filter layers a daily standard pivot over a mid-period trend MA and tints the background when price is above PP and the MA slopes up — i.e., trend and structure agree.
- Removes chop signals that fight the trend.
- Use the green tint as a long bias, red tint as a short bias, neutral as no-trade.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Pivot Trend Filter", overlay=true)
maLen = input.int(50, "Trend MA length", minval=5, maxval=200)
colorFill = input.color("color.yellow", "Color Fill")
colorUp = input.color("color.green", "Color Up")
colorDown = input.color("color.red", "Color Down")
colorLine = input.color("color.blue", "Color Line")
pp = (ta.highest(high, 1)[1] + ta.lowest(low, 1)[1] + close[1]) / 3
r1 = 2*pp - ta.lowest(low, 1)[1]
s1 = 2*pp - ta.highest(high, 1)[1]
trendMa = ta.rma(close, maLen)
bullConf = close > pp and close > trendMa and trendMa > trendMa[1]
bearConf = close < pp and close < trendMa and trendMa < trendMa[1]
p_PP = plot(pp, "PP", color=colorFill, style=plot.style_linebr)
p_R1 = plot(r1, "R1", color=colorUp, style=plot.style_linebr)
p_S1 = plot(s1, "S1", color=colorDown, style=plot.style_linebr)
p_Trend_MA = plot(trendMa, "Trend MA", color=colorLine, linewidth=2)
alertcondition(bullConf and not bullConf[1], "Bullish confluence", "Pivot + MA both turned bullish")
alertcondition(bearConf and not bearConf[1], "Bearish confluence", "Pivot + MA both turned bearish")
No comments yet.
Sign in to comment.