OPEN-SOURCE SCRIPT
Adaptive Trend Step[NeuraAlgo]

Adaptive Trend Step[NeuraAlgo]
Overview
Purpose / Description
The Adaptive Trend Step indicator is designed to track price trends while adapting to market volatility 🌊. It uses adaptive volatility scaling ⚖️ to create a dynamic step-like trend line 📈📉, helping traders identify uptrends 🔵, downtrends 🟠, and neutral phases 🟣. The line adjusts automatically depending on market volatility, making it responsive in fast markets ⚡ and smooth in quiet markets ✨.

How It Works
Efficiency Ratio (ER) ⚡
• Measures the strength of the current price movement relative to recent price changes.
Formula:
ER = (absolute change over 'length') / (sum of absolute changes over 'length')
• ER ranges 0–1, indicating strong trends (closer to 1) or sideways markets (closer to 0).
Adaptive Standard Deviation (Adaptive Dev) 📏
Combines fast and slow standard deviations, weighted by ER:
Adaptive Dev = ER * fast_dev + (1 - ER) * slow_dev
• Creates a tight threshold in strong trends ⚡ and wider threshold in sideways markets 🌫️.
Trend Calculation (trend_val) 🔄
• Compares price against the previous trend ± adaptive deviation:
○ Price > previous trend + adaptive_dev → trend moves up 🔵
○ Price < previous trend - adaptive_dev → trend moves down 🟠
○ Otherwise → trend stays neutral 🟣
Smoothing ✨
Uses a weighted average to smooth the trend:
trend_smooth = trend_val * smooth_factor + previous_trend_val * (1 - smooth_factor)
• smooth_factor controls responsiveness vs. smoothness.
Trend Coloring 🎨
• Uptrend 🔵, Downtrend 🟠, Neutral 🟣
Plotting 🖌️
• Thin line with diamond steps 💎 for precision.
• Thick semi-transparent line 🌫️ for trend highlighting.
Alerts 🚨
• Triggers uptrend ⬆️ or downtrend ⬇️ alerts in real-time.
Inputs / Settings
Main Settings 🛠️
• ER Length – Bars to calculate Efficiency Ratio (default 100)
• Fast StdDev Length – Fast volatility length (default 50)
• Slow StdDev Length – Slow volatility length (default 200)
• Source – Price source (default close)
• Smoothing Factor – Smoothness control (default 0.5, step 0.05)
Art / Visual Settings 🎨
• Up Trend Color 🔵 – Uptrend color (default blue)
• Down Trend Color 🟠 – Downtrend color (default orange)
• Neutral Trend Color 🟣 – Neutral color (default purple)
Use Cases 💡
• Identify current trend direction and reversals 🔄
• Determine entry & exit points 🎯
• Combine with other indicators (RSI, MACD) for trade confirmation ✅
• Adaptable to volatile ⚡ or sideways 🌫️ markets
In short:
The Adaptive Trend Step is a dynamic trend-following tool 📈 that adjusts automatically to market volatility ⚖️, helping traders spot trends 🔵🟠🟣 without being too noisy during sideways movements 🌊.
Overview
Purpose / Description
The Adaptive Trend Step indicator is designed to track price trends while adapting to market volatility 🌊. It uses adaptive volatility scaling ⚖️ to create a dynamic step-like trend line 📈📉, helping traders identify uptrends 🔵, downtrends 🟠, and neutral phases 🟣. The line adjusts automatically depending on market volatility, making it responsive in fast markets ⚡ and smooth in quiet markets ✨.
How It Works
Efficiency Ratio (ER) ⚡
• Measures the strength of the current price movement relative to recent price changes.
Formula:
ER = (absolute change over 'length') / (sum of absolute changes over 'length')
• ER ranges 0–1, indicating strong trends (closer to 1) or sideways markets (closer to 0).
Adaptive Standard Deviation (Adaptive Dev) 📏
Combines fast and slow standard deviations, weighted by ER:
Adaptive Dev = ER * fast_dev + (1 - ER) * slow_dev
• Creates a tight threshold in strong trends ⚡ and wider threshold in sideways markets 🌫️.
Trend Calculation (trend_val) 🔄
• Compares price against the previous trend ± adaptive deviation:
○ Price > previous trend + adaptive_dev → trend moves up 🔵
○ Price < previous trend - adaptive_dev → trend moves down 🟠
○ Otherwise → trend stays neutral 🟣
Smoothing ✨
Uses a weighted average to smooth the trend:
trend_smooth = trend_val * smooth_factor + previous_trend_val * (1 - smooth_factor)
• smooth_factor controls responsiveness vs. smoothness.
Trend Coloring 🎨
• Uptrend 🔵, Downtrend 🟠, Neutral 🟣
Plotting 🖌️
• Thin line with diamond steps 💎 for precision.
• Thick semi-transparent line 🌫️ for trend highlighting.
Alerts 🚨
• Triggers uptrend ⬆️ or downtrend ⬇️ alerts in real-time.
Inputs / Settings
Main Settings 🛠️
• ER Length – Bars to calculate Efficiency Ratio (default 100)
• Fast StdDev Length – Fast volatility length (default 50)
• Slow StdDev Length – Slow volatility length (default 200)
• Source – Price source (default close)
• Smoothing Factor – Smoothness control (default 0.5, step 0.05)
Art / Visual Settings 🎨
• Up Trend Color 🔵 – Uptrend color (default blue)
• Down Trend Color 🟠 – Downtrend color (default orange)
• Neutral Trend Color 🟣 – Neutral color (default purple)
Use Cases 💡
• Identify current trend direction and reversals 🔄
• Determine entry & exit points 🎯
• Combine with other indicators (RSI, MACD) for trade confirmation ✅
• Adaptable to volatile ⚡ or sideways 🌫️ markets
In short:
The Adaptive Trend Step is a dynamic trend-following tool 📈 that adjusts automatically to market volatility ⚖️, helping traders spot trends 🔵🟠🟣 without being too noisy during sideways movements 🌊.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.