Key Components:
Exponential Moving Averages (EMAs):
The indicator uses two EMAs: a fast 50-period EMA and a slow 200-period EMA. These are used to determine the general market trend.
A bullish trend is when the fast EMA (50) is above the slow EMA (200), and both EMAs are sloping upward.
A bearish trend is when the fast EMA (50) is below the slow EMA (200), and both EMAs are sloping downward.
Stochastic Oscillator:
This measures whether the market is overbought or oversold. A reading below a set threshold (e.g., 20) indicates the market is oversold, and above another threshold (e.g., 80) means the market is overbought.
Price Proximity to the 50 EMA:
The indicator checks if the current price is close enough to the 50 EMA (within a set percentage). This can help confirm if the price is at a level where a potential trade might be more reliable.
Retracement Conditions:
The indicator looks for price retracements (pullbacks) using the Average True Range (ATR) to check if the price is moving significantly from recent highs or lows.
Cooldown Mechanism:
To avoid too many signals in a short period, the indicator uses a cooldown timer that prevents buy or sell alerts from triggering again until a set number of bars (candles) have passed since the last signal.
Time Filter:
Users can set specific start and end times for when alerts should be active during the trading day. This allows you to limit when you receive buy or sell signals, based on your preferred trading hours.
How Buy and Sell Signals Work:
Buy Signal: A buy alert will only trigger if the market is in a bullish trend, the price is near the 50 EMA, the stochastic oscillator is oversold, and the price is showing a valid upward retracement.
Sell Signal: A sell alert will only trigger if the market is in a bearish trend, the price is near the 50 EMA, the stochastic oscillator is overbought, and the price is showing a valid downward retracement.
Alerts and Visualization:
When a valid buy or sell condition is met, an alert is sent to the user, but only during the user-defined trading hours.
Buy signals are displayed as green labels below the price bars, and sell signals are shown as red labels above the price bars.
The 50 EMA and 200 EMA lines are plotted on the chart to help visualize the trend direction.