OPEN-SOURCE SCRIPT
업데이트됨 Trend Sniper v2.5 [Jamallo]

(2025)
Intro
Trend Sniper v2.5 is built around a novel-unique core construction —
the Butterworth Stop: a ratcheting trailing stop anchored to a 2-Pole Butterworth Super Smoother and dynamically sized by Parkinson Volatility.
While each algorithm used is individually well-documented, this specific combination is rare and not found in standard indicator libraries — most Butterworth implementations are simply plotted as trend lines, not used as the structural anchor of a volatility-adaptive stop mechanism.
Break down:
2-Pole Butterworth Super Smoother (Core Trend Line) (smoothed price)
The backbone of the indicator is a 2-Pole Butterworth Super Smoother, a concept brought into trading by engineer and author John Ehlers, first published in his 2004 book Cybernetic Analysis for Stocks and Futures
In this indicator: The Butterworth filter runs onPine Script® with a user-defined period (default 20) and produces Pine Script® — a clean, lag-minimized version of price. This smoothed value is not plotted directly. Instead, it acts as the anchor point for the trailing stop. The stop is placed at Pine Script® , meaning the stop hugs the filtered trend rather than raw price, making it far less susceptible to wick noise and erratic bars. Without this pre-filtering step, the trailing stop would oscillate erratically on volatile bars.
Parkinson Volatility (Sizes the Stop Distance)
"Developed by physicist Michael Parkinson in 1980, it estimates volatility using the natural logarithm of the high-to-low ratio each period, capturing intraday range rather than just close-to-close movement."
In this indicator: Parkinson Volatility is calculated over a rolling window (default 50 bars) and multiplied byPine Script® (default 1.2) to produce Pine Script® . When markets are volatile, Pine Script® expands and the stop gives price more room. When markets are quiet, it contracts and the stop tightens.
Butterworth Stop State Machine (The Main Line You Watch)
This is the primary plotted line, It's a classic ratcheting trailing stop built on top of outputs from steps 1 and 2.
In this indicator: The logic is a simple state machine with two modes — uptrend and downtrend. In an uptrend, the stop only moves up (never down), tracking atPine Script® . In a downtrend, it only moves down, tracking atPine Script® . When price closes on the wrong side of the stop, the state flips and the stop resets on the other side of the trend line. Because both the anchor Pine Script® and the buffer Pine Script® are noise-filtered and volatility-adjusted, the BW Stop flips far less often than a raw price-based trailing stop would, keeping you in trends longer.
Chande Momentum Oscillator + Deadband (Colors the BW Stop Line)
"The CMO measures momentum by calculating the difference between the sum of gains and the sum of losses over a specified period, dividing by their total to produce a normalized scale from -100 to +100 that accounts for both up and down days simultaneously."
In this indicator: CMO is calculated onPine Script® itself (not raw price), over 14 bars by default. A deadband of ±10 is applied — the line only turns bull-colored when CMO exceeds +10, and bear-colored when it drops below −10. It does not change color in between.
KAMA Midpoint (The Dynamic Midline and Fill Zone Anchor)
"Introduced by Perry Kaufman in 1995, KAMA dynamically adjusts its smoothing based on the relative efficiency of price movement".
In this indicator: Rather than applying KAMA to price directly, it's applied to the midpoint between the BW Stop and the Slow SuperTrend. This midpoint is a computed halfway value between the two lines. KAMA then smooths that midpoint adaptively, producing `kama_mid`. The fill colors you see on the chart are drawn betweenPine Script® and Pine Script® — not between price and anything else.
Dual SuperTrend (Signals and Fill State Logic)
"Created by Olivier Seban, SuperTrend combines ATR-based volatility with trend detection into a single line that repositions dynamically as price confirms or breaks the current trend direction."
In this indicator: Two SuperTrend lines run simultaneously.
Putting It All Together
The flow through the indicator is linear: Butterworth smooths price → Parkinson sizes the stop → the state machine builds the stop line → CMO colors it → KAMA anchors the midline fill → the dual SuperTrend fires signals and shades conviction.
END
Every component feeds the next, meaning the final signals and visuals are the product of five sequential filters rather than any single calculation — which is what gives the indicator its resistance to false signals in noisy market conditions.
Intro
Trend Sniper v2.5 is built around a novel-unique core construction —
the Butterworth Stop: a ratcheting trailing stop anchored to a 2-Pole Butterworth Super Smoother and dynamically sized by Parkinson Volatility.
While each algorithm used is individually well-documented, this specific combination is rare and not found in standard indicator libraries — most Butterworth implementations are simply plotted as trend lines, not used as the structural anchor of a volatility-adaptive stop mechanism.
Break down:
2-Pole Butterworth Super Smoother (Core Trend Line) (smoothed price)
The backbone of the indicator is a 2-Pole Butterworth Super Smoother, a concept brought into trading by engineer and author John Ehlers, first published in his 2004 book Cybernetic Analysis for Stocks and Futures
In this indicator: The Butterworth filter runs on
close
bw_trend
bw_trend ± stop_dist
Parkinson Volatility (Sizes the Stop Distance)
"Developed by physicist Michael Parkinson in 1980, it estimates volatility using the natural logarithm of the high-to-low ratio each period, capturing intraday range rather than just close-to-close movement."
In this indicator: Parkinson Volatility is calculated over a rolling window (default 50 bars) and multiplied by
stop_mult
stop_dist
stop_dist
Butterworth Stop State Machine (The Main Line You Watch)
This is the primary plotted line, It's a classic ratcheting trailing stop built on top of outputs from steps 1 and 2.
In this indicator: The logic is a simple state machine with two modes — uptrend and downtrend. In an uptrend, the stop only moves up (never down), tracking at
bw_trend − stop_dist
bw_trend + stop_dist
bw_trend
stop_dist
Chande Momentum Oscillator + Deadband (Colors the BW Stop Line)
"The CMO measures momentum by calculating the difference between the sum of gains and the sum of losses over a specified period, dividing by their total to produce a normalized scale from -100 to +100 that accounts for both up and down days simultaneously."
In this indicator: CMO is calculated on
bw_stop
KAMA Midpoint (The Dynamic Midline and Fill Zone Anchor)
"Introduced by Perry Kaufman in 1995, KAMA dynamically adjusts its smoothing based on the relative efficiency of price movement".
In this indicator: Rather than applying KAMA to price directly, it's applied to the midpoint between the BW Stop and the Slow SuperTrend. This midpoint is a computed halfway value between the two lines. KAMA then smooths that midpoint adaptively, producing `kama_mid`. The fill colors you see on the chart are drawn between
kama_mid
bw_stop
Dual SuperTrend (Signals and Fill State Logic)
"Created by Olivier Seban, SuperTrend combines ATR-based volatility with trend detection into a single line that repositions dynamically as price confirms or breaks the current trend direction."
In this indicator: Two SuperTrend lines run simultaneously.
- The Slow ST (9× ATR) is the macro trend reference.
- The Fast ST (6× ATR) is never plotted at full size — it's compressed halfway toward the BW Stop and shown as orange circles
Pine Script® fast_shortened
Putting It All Together
The flow through the indicator is linear: Butterworth smooths price → Parkinson sizes the stop → the state machine builds the stop line → CMO colors it → KAMA anchors the midline fill → the dual SuperTrend fires signals and shades conviction.
END
Every component feeds the next, meaning the final signals and visuals are the product of five sequential filters rather than any single calculation — which is what gives the indicator its resistance to false signals in noisy market conditions.
릴리즈 노트
Changes made:- Removed the local `pi` variable in `f_super_smoother`, replaced with `math.pi` directly
- Removed intermediate `park_vol` variable, inlined into `stop_dist`
- Removed unused `st_hl2` alias for `hl2`
- Simplified `mid_raw` + redundant ternary away, replaced with `(st_slow + bw_stop) / 2.0` directly into `f_kama` call
- Same fix for `fast_shortened` → `fast_mid`, now `(st_fast + bw_stop) / 2.0`
- `fast_mid` extracted as a variable since it's referenced four times in the fills
릴리즈 노트
- HLC4 price source릴리즈 노트
- Added Percentile Bands group in inputs with lookback period (default 100), inner percentile level (default 68%), and show/hide toggle- Bands are built from `bw_deviation` — the rolling distance between `ha_close` and `bw_stop` — so the channel width reflects how far price historically strays from the filtered stop line
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.