Multiple Moving Average Deviation Composite Indicator
Multi-Moving Average Deviation Comprehensive Indicator
Indicator Name Multi-Moving Average Deviation Comprehensive Indicator (Short Title: Multi-MA Deviation Indicator)
**Design Concept** This indicator is based on the deviation rates of multiple Exponential Moving Averages (EMA) to analyze market trends, overbought/oversold regions, and potential buy/sell signals. By visualizing comprehensive deviations and MACD-like signals, it provides intuitive market dynamics and deeper insights into price behavior through divergence detection.
Logic and Implementation Details
1. **Calculation of Multiple EMAs** - Four user-defined periods (default: 20, 50, 100, 200) are used to calculate EMAs. - Each EMA reflects the price trend over a specific timeframe.
2. **Deviation Rate Calculation** - **Types of Deviation:** - Deviation between closing price and EMA20: dif20 = \frac{close}{EMA20} \times 100 - 100$ - Deviation between EMA20 and EMA50: dif25 = \frac{EMA20}{EMA50} \times 100 - 100$ - Deviation between EMA50 and EMA100: dif51 = \frac{EMA50}{EMA100} \times 100 - 100$ - Deviation between EMA100 and EMA200: dif120 = \frac{EMA100}{EMA200} \times 100 - 100$ - Comprehensive Deviation Indicator (difxx): Combines the above deviations with equal weighting to reflect the overall trend deviation.
3. **Trend Determination** - If the comprehensive deviation (`difxx`) is positive, the market is in an uptrend. - If `difxx` is negative, the market is in a downtrend.
4. **MACD-Like Dynamic Analysis** - Computes the Simple Moving Average (SMA) and Exponential Moving Average (EMA) of the comprehensive deviation (`difxx`) to generate MACD-like signals. - The histogram difference reflects market momentum changes. - Histogram crossing from negative to positive triggers a buy signal, while crossing from positive to negative triggers a sell signal.
5. **Overbought and Oversold Regions** - Defines dynamic overbought (`difmax`) and oversold (`difmin`) levels based on historical lowest and highest values of `difxx`. - Values above `difmax` indicate an overbought region, and values below `difmin` indicate an oversold region.
6. **Divergence Detection** - **Bearish Divergence:** Price makes a new high, but `difxx` does not. - **Bullish Divergence:** Price makes a new low, but `difxx` does not. - Divergence signals are marked on the chart for clarity.
7. **Trend Labels** - Displays the current trend state (uptrend, downtrend, or sideways) on the chart.
How to Use
Parameter Settings - Users can customize the following parameters to adapt to different market conditions: - EMA periods (default: 20, 50, 100, 200) - Length for calculating overbought and oversold levels (default: 200)
Key Signals 1. **Buy Signal** - Triggered when the MACD histogram crosses from negative to positive. - Buy signals in the oversold region are more reliable.
2. **Sell Signal** - Triggered when the MACD histogram crosses from positive to negative. - Sell signals in the overbought region carry higher risk.
3. **Trend Determination** - Background color indicates the current trend: - **Green Background:** Uptrend. - **Red Background:** Downtrend.
Application Scenarios - **Short-Term Trading:** Capture short-term reversals using overbought/oversold signals. - **Trend Following:** Use `difxx` to identify trends and confirm them with MACD momentum. - **Divergence Analysis:** Spot turning points in the market.
Notes 1. **Market Adaptability:** - This indicator works best in trending markets but may produce false signals in sideways markets. 2. **Parameter Optimization:** - Adjust EMA periods and divergence detection windows based on the characteristics of the asset being traded. 3. **Combination with Other Tools:** - Enhance results by combining this indicator with other technical tools, such as Bollinger Bands or RSI.
This indicator allows traders to grasp market trends clearly, identify trading opportunities, and gain a deeper understanding of market behavior.
تم نشر هذا النص البرمجي بمصدر غير مفتوح ويمكنك استخدامه بحرية. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني. لا يمكنك مشاهدة أو تعديل كود المصدر الخاص به.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
初级课程(软件使用/个人指标使用逻辑,授权个人常用技术指标1个)
全套课程(整套量化体系,授权个人常用技术指标5个)
微信:AASFANS
Primary course (software usage/personal indicator usage logic, authorized personal 1 commonly used technical indicator)
Full course
يعمل أيضًا:
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.