
An adaptive trend-following indicator using Variable Index Dynamic Average (VIDYA) with a rolling loop function to assess market trend strength and direction dynamically.
Explore complementary indicator rolesHow it works
The VIDYA For-Loop operates by calculating a Variable Index Dynamic Average that adapts its smoothing based on market volatility. It uses a standard deviation calculation to determine the responsiveness of the moving average, making it more sensitive to current market conditions.
The indicator then applies a recursive loop function across a defined lookback range, measuring the number of times price trends higher or lower. By continuously comparing VIDYA values, it generates a momentum-based score that helps quantify trend persistence and provides a clear directional bias.
Why it may be useful
This indicator provides traders with a sophisticated, adaptive approach to trend analysis that goes beyond traditional static moving averages. By dynamically adjusting to market volatility, it offers more precise and responsive trend detection, helping traders identify stronger and more reliable market movements.
The VIDYA For-Loop's unique combination of adaptive smoothing and recursive trend evaluation allows traders to filter out market noise and focus on substantive price trends. Its ability to generate clear long and short signals based on customizable thresholds makes it a powerful tool for traders seeking more nuanced market insights.
When to explore it
The VIDYA For-Loop is most effective in markets with clear, sustained trends where price movement shows consistent directional momentum. It performs exceptionally well in trending markets across multiple timeframes, from short-term scalping to longer-term swing trading environments.
Traders should consider using this indicator during periods of moderate to high market volatility, where traditional moving averages might lag or provide less accurate signals. It is particularly useful for algorithmic and systematic trading strategies that require precise, adaptive trend identification and robust entry and exit conditions.
Keep exploring
What we’ve verified
Access, alerts and repainting behaviour have not been independently verified for this indicator. Check the creator’s current publication and settings.
General descriptions and classifications are recovered research. Verified details above identify the specific checks we have completed. Check the creator’s current publication for later changes.



![PDF MA For Loop [BackQuant] chart preview](https://s3.tradingview.com/y/yzgkH1Dh.png?v=1737577939)
![Zero Lag Signals For Loop [QuantAlgo] chart preview](https://s3.tradingview.com/j/jbhEadsV.png?v=1735387609)

