OPEN-SOURCE SCRIPT
VIDYA (Chande)

This script brings you VIDYA – the Variable Index Dynamic Average, developed by Tushar Chande. It’s not your typical moving average. Unlike the standard SMA or EMA, VIDYA adapts its speed and smoothness based on real-time market momentum using the Chande Momentum Oscillator (CMO).
Think of it like a moving average that gets faster during strong trends and slows down during sideways or choppy markets — just like how a smart trader would!
🧠 What Makes VIDYA Different?
Traditional moving averages use fixed smoothing, so they lag more during big moves or chop during weak trends.
VIDYA fixes that by adapting its behavior dynamically:
When momentum is strong → VIDYA reacts faster 🚀
When momentum is weak → VIDYA smooths out the noise 🧘
⚙️ How It Works (Explained Simply):
1️⃣ CMO Calculation (Chande Momentum Oscillator):
We look at the past cmoLength candles (default 9) and:
i) Add up all the positive price changes (gains)
ii) Add up all the negative price changes (losses)
iii) Use those to compute a normalized momentum score between -100 and +100
📌 CMO = (Gains - Losses) / (Gains + Losses)
• This gives us a momentum reading that powers the next step.
2️⃣ Dynamic Alpha Smoothing:
• We convert the absolute value of the CMO into an alpha — this is the "speed" of the VIDYA.
📌 Higher momentum = higher alpha → faster response
📌 Lower momentum = lower alpha → smoother behavior
3️⃣ VIDYA Formula:
• Finally, we apply the smoothing:
📌 VIDYA = α × Price + (1 - α) × Previous VIDYA
• This equation continuously adapts to market behavior — trending or ranging.
📊 What’s Plotted?
🟠 The VIDYA Line:
A smooth, responsive line plotted on your price chart that adjusts in real-time with price momentum.
🔎 How to Use It:
✅ Use it like a moving average, but smarter:
• Price > VIDYA and rising → Trend is likely up
• Price < VIDYA and falling → Trend is likely down
• Flat VIDYA = Possible consolidation or sideways market
✅ Combine with:
• Breakout strategies (VIDYA confirms momentum)
• Reversal entries (look for price crossing VIDYA)
• Volatility filters (ignore signals when VIDYA flattens)
🧪 Bonus Tip:
Pair this with a volume indicator (like my Volume Confirmation Bars or Volume Strength Highlight) to confirm whether momentum is backed by real participation or just a fakeout.
📩 Want alerts, dual-timeframe overlays, or VIDYA with other base inputs (like typical price or HLC3)? Let me know — happy to expand this for your setup!
Stay adaptive, not reactive — trade smarter with VIDYA! 🧠📉📈
Think of it like a moving average that gets faster during strong trends and slows down during sideways or choppy markets — just like how a smart trader would!
🧠 What Makes VIDYA Different?
Traditional moving averages use fixed smoothing, so they lag more during big moves or chop during weak trends.
VIDYA fixes that by adapting its behavior dynamically:
When momentum is strong → VIDYA reacts faster 🚀
When momentum is weak → VIDYA smooths out the noise 🧘
⚙️ How It Works (Explained Simply):
1️⃣ CMO Calculation (Chande Momentum Oscillator):
We look at the past cmoLength candles (default 9) and:
i) Add up all the positive price changes (gains)
ii) Add up all the negative price changes (losses)
iii) Use those to compute a normalized momentum score between -100 and +100
📌 CMO = (Gains - Losses) / (Gains + Losses)
• This gives us a momentum reading that powers the next step.
2️⃣ Dynamic Alpha Smoothing:
• We convert the absolute value of the CMO into an alpha — this is the "speed" of the VIDYA.
📌 Higher momentum = higher alpha → faster response
📌 Lower momentum = lower alpha → smoother behavior
3️⃣ VIDYA Formula:
• Finally, we apply the smoothing:
📌 VIDYA = α × Price + (1 - α) × Previous VIDYA
• This equation continuously adapts to market behavior — trending or ranging.
📊 What’s Plotted?
🟠 The VIDYA Line:
A smooth, responsive line plotted on your price chart that adjusts in real-time with price momentum.
🔎 How to Use It:
✅ Use it like a moving average, but smarter:
• Price > VIDYA and rising → Trend is likely up
• Price < VIDYA and falling → Trend is likely down
• Flat VIDYA = Possible consolidation or sideways market
✅ Combine with:
• Breakout strategies (VIDYA confirms momentum)
• Reversal entries (look for price crossing VIDYA)
• Volatility filters (ignore signals when VIDYA flattens)
🧪 Bonus Tip:
Pair this with a volume indicator (like my Volume Confirmation Bars or Volume Strength Highlight) to confirm whether momentum is backed by real participation or just a fakeout.
📩 Want alerts, dual-timeframe overlays, or VIDYA with other base inputs (like typical price or HLC3)? Let me know — happy to expand this for your setup!
Stay adaptive, not reactive — trade smarter with VIDYA! 🧠📉📈
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.