MA Crossover + RSI Strategy Indicator This indicator is designed to provide buy (long) and sell (short) signals based on a combination of moving average (MA) crossovers, the Relative Strength Index (RSI), and a custom moving average filter. It allows traders to identify potential entry and exit points based on price trends and momentum.
Key Components Moving Averages (MAs):
Short EMA (Exponential Moving Average): Default length of 9. Long EMA: Default length of 21. These MAs are used to detect trend crossovers. A bullish trend is indicated when the short EMA crosses above the long EMA, and a bearish trend is indicated when the short EMA crosses below the long EMA. Custom Moving Average (Custom MA):
Configurable to be one of the following: SMA (Simple Moving Average), EMA, WMA (Weighted Moving Average), or VWMA (Volume Weighted Moving Average). Default length is 200, commonly used as a long-term trend indicator. Color-coded dynamically: Green: Price is above the Custom MA. Red: Price is below the Custom MA. Relative Strength Index (RSI):
Default length of 14. Customizable Overbought Level (default: 60) and Oversold Level (default: 40). Provides a momentum filter to ensure trades are taken when the market exhibits strong trends in a favorable direction. Signal Logic Buy Signal (Long Entry - XL):
The Short EMA crosses above the Long EMA (bullish crossover). RSI value is above the oversold level (indicating momentum is not excessively weak). The price is above the Custom MA, confirming alignment with the prevailing trend. Sell Signal (Short Entry - XS):
The Short EMA crosses below the Long EMA (bearish crossover). RSI value is below the overbought level (indicating momentum is not excessively strong). The price is below the Custom MA, confirming alignment with the prevailing trend. Pending Signals Pending signals account for situations where the crossover and RSI conditions are met, but the price has not yet crossed the Custom MA. These are tracked to activate only when the price moves in alignment with the Custom MA:
Pending Buy:
Triggered when: Short EMA crosses above Long EMA. RSI > Oversold Level. Price is below the Custom MA. Activates when the price crosses above the Custom MA. Pending Sell:
Triggered when: Short EMA crosses below Long EMA. RSI < Overbought Level. Price is above the Custom MA. Activates when the price crosses below the Custom MA. Visual Elements EMA Lines:
Blue Line: Short EMA. Red Line: Long EMA. Custom MA:
Green: Indicates price is above the Custom MA. Red: Indicates price is below the Custom MA. Signal Arrows:
Green UP Arrow (XL): Buy signal. Red DOWN Arrow (XS): Sell signal. Alerts Configurable alerts notify the user when:
Buy Signal: "Price crossed above the short EMA and RSI is oversold." Sell Signal: "Price crossed below the short EMA and RSI is overbought." Strategy Overview This strategy combines trend-following (EMA crossovers) and momentum confirmation (RSI) with a Custom MA filter to ensure trades align with broader market trends. The Custom MA acts as a safety check, preventing trades against the prevailing trend.
Disclaimer This script is for educational purposes only. Trading involves significant financial risk, and past performance is not indicative of future results. Use this script at your own discretion, and always backtest before deploying it in live markets. The author is not responsible for any financial losses incurred while using this script.
Suitability This indicator is suitable for traders who prefer to combine trend-based strategies with momentum confirmation to filter out false signals and increase trade reliability.
تم نشر هذا النص البرمجي بمصدر غير مفتوح ويمكنك استخدامه بحرية. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني. لا يمكنك مشاهدة أو تعديل كود المصدر الخاص به.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.