OPEN-SOURCE SCRIPT

DMI ForLoop [InvestorUnknown]

Zaktualizowano
Overview
This indicator utilizes the Directional Movement Index (DMI) combined with a for-loop to provide a robust trend analysis (ADX is not a part of this indicator).

Settings

DMI ForLoop Settings:
Start Length (a): The initial length for DMI calculation (inclusive).
End Length (b):The final length for DMI calculation (inclusive).
EMA Length (c): The length for the Exponential Moving Average applied to the DMI values, in order so smoothen the signal.

Signal Settings:
Signal Mode: Determines the mode of signal calculation. Options are "Fast", "Slow", "Thresholds Crossing", and "Fast Threshold". Default is "Fast".
1. Slow: is a simple crossing of the midline (0).
2. Fast: positive signal depends if the current "DMIema" is above "DMIema[1]" or above 0.99, otherwise the signal is negative.
3. Thresholds Crossing: simple ta.crossover and ta.crossunder of the user defined threshold for Long and Short.
4. Fast Threshold: signal changes if the value of "DMIema" changes by more than user defined threshold against the current signal.




Functionality
The DMI ForLoop indicator calculates an array of DMI values over a specified range of lengths, then averages these values and applies an EMA for smoothing. The result is a dynamic trend indicator that adapts to market conditions.

DMI Calculation:
The indicator iterates through lengths from Start Length to End Length, calculating the positive and negative directional movement (DM) for each period and calculates the average of all the signals at the end. A custom function version of the DMI is used here in order to use DMI with "series" inputs.



This indicator is versatile and can be tailored to fit various trading/investing strategies by adjusting the input parameters and signal modes.
Informacje o Wersji
Update:

- option to choose different type of Moving Average



- Adjusted signal calculation for the "Fast" signal to work well with different types of the Moving Average



- Added Alerts


Trend Analysis

Skrypt open-source

W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Chcesz użyć tego skryptu na wykresie?

Wyłączenie odpowiedzialności