OPEN-SOURCE SCRIPT
Telah dikemas kini EMA Regime Filter

EMA REGIME FILTER INDICATOR
✦ OVERVIEW
The EMA Regime Filter is a custom indicator, designed to identify and visualize different market regimes based on the relationship between price action and an Exponential Moving Average (EMA).
✦ KEY FEATURES
✦ INPUT PARAMETERS
✦ HOW IT WORKS
✦ USING THE INDICATOR
✦ OVERVIEW
The EMA Regime Filter is a custom indicator, designed to identify and visualize different market regimes based on the relationship between price action and an Exponential Moving Average (EMA).
✦ KEY FEATURES
- Identifies four distinct market regimes: Strong Bullish, Weak Bullish, Strong Bearish, and Weak Bearish
- Uses a current/higher timeframe for calculations to reduce noise
- Incorporates ATR (Average True Range) to determine significant price moves
- Includes an inactivity timer to revert to a neutral state after periods of low volatility
- Visualizes the regime through bar colors and candle plots
✦ INPUT PARAMETERS
- Source Timeframe: The timeframe used for calculations (default is the chart's timeframe)
- ATR Threshold For Significant Move: Multiplier for ATR to determine significant price moves (default: 0.5)
- Inactive Regime Period: Number of periods of inactivity before reverting to neutral (default: 10)
- EMA Length: Period for the Exponential Moving Average calculation (default: 22)
✦ HOW IT WORKS
- Higher Timeframe Data: The indicator requests data from a higher timeframe specified by the user.
- Significant Move Detection:
Calculates ATR and multiplies it by the user-defined threshold.
Compares the body width of each candle to this threshold to determine if it's a significant move.
- EMA Calculation: Computes an EMA based on the user-defined length.
- Regime Determination:
Strong Bullish (2): Significant bullish move above EMA
Weak Bullish (1): Transitioning from bearish, but still above EMA
Strong Bearish (-2): Significant bearish move below EMA
Weak Bearish (-1): Transitioning from bullish, but still below EMA
Neutral (0): After a period of inactivity or at the start
- Regime Transitions:
The indicator tracks the current regime and updates it based on new significant moves and the price's relation to the EMA.
An inactivity counter reverts the regime to neutral if no significant moves occur for the specified period.
- Visualization:
- Bar colors change based on the current regime (lime for bullish, red for bearish, white for neutral).
- The intensity of the color indicates the strength of the regime.
- Bar colors change based on the current regime (lime for bullish, red for bearish, white for neutral).
✦ USING THE INDICATOR
- Add the indicator to your TradingView chart.
- Adjust the input parameters as needed:
Increase the ATR threshold for fewer but more significant regime changes.
Adjust the inactive period to change how quickly the indicator reverts to neutral.
Modify the EMA length to suit your trading timeframe.
- Observe the changing bar colors to identify the current market regime.
- Use the regime information to inform your trading decisions, such as:
- Looking for long opportunities in bullish regimes
- Considering short positions in bearish regimes
- Being cautious or staying out of the market during neutral regimes
- Looking for long opportunities in bullish regimes
Nota Keluaran
- Changed the display chart for claritySkrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.