Dysmen Signals Indicator (use on 1m-5m-15m-1h)
The "Dysmen Signals" indicator is designed to provide clear buy and sell signals based on the crossover of various Exponential Moving Averages (EMAs). This indicator employs a combination of short-term and long-term EMA crossovers to identify potential trading opportunities while also highlighting significant market movements through specific signals such as the Golden Cross and Death Cross.
Indicator Components
1. Exponential Moving Averages (EMAs)
- EMA 14: A short-term EMA calculated over 14 periods.
- EMA 20: Another short-term EMA calculated over 20 periods.
- EMA 50: A mid-term EMA used as a trend filter.
- EMA 200: A long-term EMA representing the overall trend.
2. Buy and Sell Signals
- Buy Signal: Triggered when the EMA 14 crosses above the EMA 20, the closing price is above the EMA 50, and the closing price is above the EMA 200. This suggests a bullish trend in the market.
- Sell Signal: Triggered when the EMA 14 crosses below the EMA 20, the closing price is below the EMA 50, and the closing price is below the EMA 200. This indicates a bearish trend in the market.
3. Golden Cross and Death Cross
- Golden Cross (GC): Occurs when the EMA 50 crosses above the EMA 200. This is a strong bullish signal indicating a potential long-term upward trend.
- Death Cross (DC): Occurs when the EMA 50 crosses below the EMA 200. This is a strong bearish signal suggesting a potential long-term downward trend.
4. Signal Visualization
- Buy and Sell signals: Marked on the chart with green and red triangles respectively. These signals help traders identify potential entry and exit points.
- Golden Cross and Death Cross signals: Indicated with yellow and purple diamonds respectively, providing insight into major market trend shifts.
5. Candle Coloring
- Buy Trend: Candles are colored green if the EMA 14 is above the EMA 20 and the closing price is above the EMA 50 and EMA 200.
- Sell Trend: Candles are colored red if the EMA 14 is below the EMA 20 and the closing price is below the EMA 50 and EMA 200.
- If the EMA 14 crosses the EMA 20 and the closing price is below the EMA 50 but above the EMA 200, the candles are colored red, but no sell signal is given.
- If the EMA 14 crosses above the EMA 20 and the closing price is above the EMA 50 but below the EMA 200, the candles are colored green, but no buy signal is given.
6. EMA 200 Plotting
- The EMA 200 is plotted as a yellow, semi-thick line on the chart. This line serves as a reference for the overall long-term trend.
Detailed Code Explanation
- EMA Calculations: The script calculates the EMA for 14, 20, 50, and 200 periods using the ta.ema function.
- Crossover Conditions: It uses the ta.crossover and ta.crossunder functions to detect when the EMAs cross each other, triggering buy and sell signals.
- Plotting Signals: The plotshape function is utilized to display BUY and SELL signals as well as Golden Cross and Death Cross signals on the chart.
- Candle Coloring Logic: A variable direction is used to store the current market direction based on the latest signal, which then determines the candle colors using the barcolor function. The candles remain colored according to the trend until the trend is broken.
- EMA 200 Display: The plot function is used to draw the EMA 200 line on the chart with the specified color and thickness.