OPEN-SOURCE SCRIPT

SMA DMA Crossing Signal

Aktualisiert
SMA and DMA Crossing Buy Sell Signals

This script implements a Double Moving Average (DMA) strategy, a popular technical analysis technique used by traders to identify trends and potential buy/sell signals in financial markets.

**Description:**

The Double Moving Average strategy involves the calculation of two moving averages – a short-term moving average and a long-term moving average. In this script, we calculate these moving averages as follows:

1. **Short-term DMA (`dmaShort`):**
- Calculated using a 28-bar Simple Moving Average (SMA).
- Represents the shorter-term trend in the price movement.

2. **Long-term DMA (`dmaLong`):**
- Also calculated using a 28-bar SMA.
- Displaced backward by 14 bars (`dmaLong := request.security(syminfo.tickerid, "D", dmaLong[14])`), effectively creating a 28-bar SMA with a -14 bar displacement.
- Represents the longer-term trend in the price movement.

**Signals:**

Buy and sell signals are generated based on the crossing of the short-term DMA over or under the long-term DMA:

- **Buy Signal (`DMA BUY`):** Occurs when the short-term DMA crosses above the long-term DMA (`dmaBuySignal`).
- **Sell Signal (`DMA SELL`):** Occurs when the short-term DMA crosses below the long-term DMA (`dmaSellSignal`).

**How to Use:**

- **Buy Signal:** Consider entering a long position when the short-term DMA crosses above the long-term DMA, indicating a potential uptrend.
- **Sell Signal:** Consider exiting a long position or entering a short position when the short-term DMA crosses below the long-term DMA, indicating a potential downtrend.

This script provides a visual representation of the DMA crossover signals on the chart, helping traders identify potential entry and exit points in the market.

**Note:** It's important to combine DMA signals with other technical analysis tools and risk management strategies for informed trading decisions.

All comments are welcome..
Versionshinweise
Double Moving Average Crossings Indicator
Overview
The Double Moving Average (DMA) Crossings indicator is a powerful tool designed to help traders identify potential buy and sell signals based on the crossover of two moving averages with different displacements. This indicator combines short and long Double Moving Averages (DMA) along with traditional Simple Moving Averages (SMA) to provide a comprehensive view of market trends and potential reversal points.

Key Features
DMA Short and Long: The indicator calculates two DMAs with the same period but different displacements, providing a more dynamic view of the market.
DMA Short: Plotted in fuchsia color with a circle style line for better visibility.
DMA Long: Plotted in aqua color with a cross style line to distinguish from the short DMA.

Simple Moving Averages:
SMA 30: Plotted in yellow, representing the short-term trend.
SMA 50: Plotted in blue, indicating the intermediate trend.
SMA 200: Plotted in green, showing the long-term trend.

Buy and Sell Signals:
Buy Signal: Generated when the short DMA crosses above the long DMA, indicated by a green upward arrow below the bar.
Sell Signal: Generated when the short DMA crosses below the long DMA, shown by a red downward arrow above the bar.

Usage
This indicator is suitable for traders looking for clear and actionable signals in the market. The combination of DMAs and SMAs allows traders to:

Identify potential entry and exit points based on DMA crossovers.
Observe short-term, intermediate, and long-term trends with SMAs.
Make informed trading decisions with the help of visual buy and sell signals.
How to Interpret
Buy Signal: A green arrow below a bar indicates a potential buying opportunity. This occurs when the short DMA (fuchsia) crosses above the long DMA (aqua).

Sell Signal: A red arrow above a bar signals a potential selling point. This happens when the short DMA (fuchsia) crosses below the long DMA (aqua).

Trend Analysis: The SMAs provide additional context for trend direction:
SMA 30 (yellow) shows the short-term trend.
SMA 50 (blue) reflects the intermediate trend.
SMA 200 (green) represents the long-term trend.

When SMA 30 crosses over the SMA 50 it is bullish and When it crosses below it is bearish trend

Conclusion
The Double Moving Average Crossings indicator is a versatile tool for traders seeking to enhance their market analysis with reliable trend and crossover signals. By combining DMAs and SMAs, this indicator offers a comprehensive view of market dynamics, making it easier to identify profitable trading opportunities.

Versionshinweise
Update: Swapped the DMA Short and DMA Long Colors
Chart patternsMoving AveragesTrend Analysis

Open-source Skript

Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun das Script auch andere Trader verstehen und prüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?

Haftungsausschluss