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 🌊.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.