OPEN-SOURCE SCRIPT

KAMA Trend Flip with Snap & Follow - SightLing Labs

45
🔭 OVERVIEW
KAMA Snap Follow [SightLing Labs] is a customized adaptation of the Kaufman Adaptive Moving Average (KAMA) that overlays a trend-tracking line on the chart. It computes an adaptive smoothing constant from the efficiency ratio, then incorporates conditional enhancements: a "snap" mechanism to boost responsiveness on significant counter-trend bars surpassing an ATR-based threshold, and a temporary "follow" mode after trend flips to intensify adaptation for a user-defined number of bars. This allows the line to hug price more closely during early reversal phases before returning to standard smoothing for noise filtration. The line colors green for upward trends (rising KAMA), red for downward (falling KAMA), and gray for neutral, with optional alerts on trend changes. If the structure invalidates (e.g., via excessive lag or unconfirmed flips), no automatic cleanup occurs—users manage via settings tweaks and backtesting.

🔭 CONCEPTS

* Adaptive smoothing core: Builds on KAMA's efficiency ratio to dynamically adjust between fast and slow constants, gliding over minor volatility while aiming to react to directional shifts.

* Snap trigger: Detects potential reversals via large bar changes opposing the prior trend, exceeding a multiplier of ATR; this temporarily amplifies the smoothing constant (capped at 1.0) to pull KAMA toward price.

* Follow mode activation: Post-flip, engages a boosted adaptation phase for a fixed bar count, forcing tighter shadowing in the new direction to reduce lag on true turns, then reverts to absorber mode.

* Trend detection: Simple comparison of current vs. prior KAMA values defines up/down/neutral, with no embedded signals—purely for visual trend context.

* Risk-aware design: No guarantees; focuses on lag reduction in simulations (e.g., 38-54% trough lag cuts on synthetic volatile series), but real-market performance varies—backtest thoroughly.

🔭 FEATURES

* Custom KAMA calculation with manual efficiency ratio and smoothing powers for baseline adaptation.

* ATR-integrated snap for reversal sensitivity, with adjustable multiplier and boost.

* Post-flip follow mode with configurable period and boost to enhance new-trend hugging.

* Trend coloring and flip alerts: Green/red/gray line with conditions for up/down/neutral; alerts on changes.

* User controls:
Source (e.g., close).
Efficiency Ratio Length (pivot-like sensitivity).
Fast/Slow Powers (adaptation speed).
ATR Length (volatility measure).
Snap Multiplier/Boost (reversal threshold/amplification).
Follow Period/Boost (post-flip duration/intensity).

* Efficient execution: Lightweight, no heavy buffers—suitable for intraday charts via backtested tweaks.

🔭 HOW TO USE

* Tune sensitivity: Shorten Efficiency Ratio Length on lower timeframes for quicker reactions; lengthen on higher for smoother trends. Test ATR Length against asset volatility.

* Monitor flips: Use green/red shifts as trend context—combine with your strategy (e.g., crossovers, support/resistance) for potential entries; alerts notify changes.

* Leverage modes: Snap helps catch sharp turns; follow mode tightens tracking post-reversal—observe on historical data to gauge lag reduction (e.g., 30-57% miss cuts on 0.20 moves in tests).

* Apply MTF: Spot broader trends on 5m; refine on 30s/1m near flips. Backtest configurations to avoid over-optimization.

* Integrate confluence: Pair with volume, RSI, or your filters; never rely solely—markets evolve, so validate via simulations and live observation.

🔭 CONCLUSION
KAMA Snap Follow [SightLing Labs] evolves standard KAMA by adding snap and follow mechanics to combat reversal lag while filtering bumps, offering a visual tool for trend analysis in volatile intraday setups. Developed to address traditional adaptive averages' delays without introducing excessive whipsaw (e.g., zero added in noisy flats per tests), it provides adjustable parameters for customization. No performance promises—results hinge on backtesting and market fit; use as a framework for scenario evaluation, not automated trading.

Example Configurations (derived from synthetic tests on SOFI-like intraday volatility; backtest and adjust):
- For 30s charts (high noise, rapid shifts): Efficiency Ratio Length=20, Fast Power=1, Slow Power=15, ATR Length=10, Snap Multiplier=1.2, Snap Boost=2.0, Follow Period=5, Follow Boost=2.5—yields ~40% lag reduction on turns, filtering 85% of <0.01 fluctuations.
- For 1m charts (moderate volatility): Efficiency Ratio Length=30, Fast Power=2, Slow Power=20, ATR Length=14, Snap Multiplier=1.5, Snap Boost=2.5, Follow Period=8, Follow Boost=3.0—achieves ~30% lower reversal misses (e.g., 0.08 vs. 0.12 on 0.20 swings), stable in 50-bar chops.
- For 5m charts (trendier flows): Efficiency Ratio Length=50, Fast Power=3, Slow Power=40, ATR Length=20, Snap Multiplier=1.8, Snap Boost=3.0, Follow Period=12, Follow Boost=3.5—boosts post-flip hug by 25%, ignoring 90% of ±0.05 noise across 100 bars.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。