OPEN-SOURCE SCRIPT
Dynamic MAs Zscore | Lyro RS

The Dynamic MAs Zscore is an adaptive momentum and valuation oscillator built around advanced moving averages and statistical Z-Score normalization. By combining a wide selection of moving average types with dynamic deviation bands, this indicator delivers clear insights into trend strength, directional bias, and relative valuation — all in a clean, visually intuitive format.
━━━━━━━━━━━━━━━
Key Features
━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━
How It Works
━━━━━━━━━━━━━━━

━━━━━━━━━━━━━━━
Signal Interpretation
━━━━━━━━━━━━━━━

━━━━━━━━━━━━━━━
Customization
━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━
Alerts
━━━━━━━━━━━━━━━
⚠️ Disclaimer
This indicator is intended for technical analysis and educational purposes only. It does not guarantee profitable outcomes and should be used alongside other tools, confirmation methods, and sound risk management. The author is not responsible for any financial decisions made using this indicator.
━━━━━━━━━━━━━━━
Key Features
━━━━━━━━━━━━━━━
- Dynamic Moving Average Engine
Applies one of 12 selectable moving average types (SMA, EMA, WMA, VWMA, HMA, ALMA, TEMA, etc.) to the chosen source. This allows fine-tuning between responsiveness and smoothness depending on market conditions. - Z-Score Normalization
Transforms the selected moving average into a standardized Z-Score:
(MA − mean) / standard deviation
This normalization makes momentum strength comparable across assets and timeframes. - Adaptive Deviation Bands
Upper and lower bands are derived from the rolling standard deviation of the Z-Score:
Custom band length
Independent positive and negative multipliers
These bands dynamically expand and contract with volatility. - Dual Signal ModesTrend Mode – Focuses on directional continuation. Color changes and signals occur when Z-Score breaks above or below deviation bands.
Valuation Mode – Highlights relative overvaluation and undervaluation using a gradient color scale and predefined value zones. - Advanced Visual System
Includes bold layered plots, gradient fills, background shading, and candle/bar coloring to clearly reflect current market state. - Custom Color Palettes
Choose from multiple preset themes (Classic, Mystic, Accented, Royal) or define your own bullish and bearish colors.
━━━━━━━━━━━━━━━
How It Works
━━━━━━━━━━━━━━━
- MA Calculation – The selected moving average type is applied to the chosen price source.
- Z-Score Computation – The MA is normalized over a user-defined lookback period to quantify deviation from its mean.
- Band Construction – Standard deviation of the Z-Score is calculated over the band length and scaled by positive/negative multipliers.
- Mode-Dependent Logic
- Trend Mode – Breaks above the upper band signal bullish momentum; breaks below the lower band signal bearish momentum.
- Valuation Mode – A gradient reflects relative valuation from undervalued to overvalued, with background highlights at extreme Z-Score levels.
- Trend Mode – Breaks above the upper band signal bullish momentum; breaks below the lower band signal bearish momentum.
━━━━━━━━━━━━━━━
Signal Interpretation
━━━━━━━━━━━━━━━
- Trend Confirmation
In Trend Mode, sustained moves beyond deviation bands indicate strong directional bias. - Momentum Strength
The distance of the Z-Score from zero reflects the intensity of trend momentum. - Relative Valuation
In Valuation Mode, deep negative Z-Scores suggest undervaluation, while high positive Z-Scores suggest overvaluation. - Visual Clarity
Bar and candle coloring aligned with oscillator state allows for rapid assessment of market conditions.
━━━━━━━━━━━━━━━
Customization
━━━━━━━━━━━━━━━
- Adjust MA type and length to balance speed vs. smoothness.
- Modify Z-Score length to control sensitivity.
- Tune band length and multipliers for volatility adaptation.
- Switch between Trend and Valuation modes depending on strategy.
- Personalize visuals using preset or custom color palettes.
━━━━━━━━━━━━━━━
Alerts
━━━━━━━━━━━━━━━
- Bullish condition when Z-Score > 0
- Bearish condition when Z-Score < 0
- Overvalued and undervalued valuation alerts
⚠️ Disclaimer
This indicator is intended for technical analysis and educational purposes only. It does not guarantee profitable outcomes and should be used alongside other tools, confirmation methods, and sound risk management. The author is not responsible for any financial decisions made using this indicator.
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.
Get access to our private indicators & analysis: whop.com/lyro-rs
Join our community: discord.gg/kcEBMWaFjS
All material from Lyro RS is for educational purposes only. Past performance does not guarantee future results.
Join our community: discord.gg/kcEBMWaFjS
All material from Lyro RS is for educational purposes only. Past performance does not guarantee future results.
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.
Get access to our private indicators & analysis: whop.com/lyro-rs
Join our community: discord.gg/kcEBMWaFjS
All material from Lyro RS is for educational purposes only. Past performance does not guarantee future results.
Join our community: discord.gg/kcEBMWaFjS
All material from Lyro RS is for educational purposes only. Past performance does not guarantee future results.
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.