OPEN-SOURCE SCRIPT
Aggiornato

Crypto MA + ATR Super Adaptative

The Crypto MA + ATR Super Adaptative Indicator is designed to help traders identify trend levels and potential support/resistance zones using a dynamic measure of volatility. It calculates a central "Mid Line" (a moving average of the closing prices) and then plots multiple bands (or levels) above and below this line. These bands are spaced using a dynamic Average True Range (ATR) that is adjusted based on recent volatility via a Relative Volatility Factor (RVF).

Key Features
Dynamic ATR Calculation:
Uses a Relative Volatility Factor (RVF) to adjust the short-term ATR based on the dispersion of recent ATR values relative to a longer-term ATR reference. This ensures that the bands widen during periods of high volatility and narrow during periods of low volatility.

Mid Line (Central Moving Average):
A customizable moving average (with options such as SMA, EMA, WMA, RMA, HMA, ALMA) calculated from closing prices, which serves as the central reference for the bands.

Multiple Trend Levels:
Seven levels (both above and below the Mid Line) are plotted. Each level is computed as a multiple (1x through 7x) of the dynamic ATR added to or subtracted from the Mid Line.

Customizable Inputs:
Users can easily adjust the lookback periods for both the Mid Line and ATR calculations, choose the type of moving average, set the base multiplier for the bands, and toggle the display of each individual level.

Time Offset Option:
An offset parameter allows shifting the plotted lines forward or backward in time to better align with the user's charting preferences.

How It Works
Mid Line Calculation:
The indicator computes a moving average (the Mid Line) based on the closing prices using a user-selected method (e.g., EMA).

ATR Calculations:

Short-Term ATR (atrShort): Reflects current volatility over a short period (default is 14 bars).
Long-Term ATR (atrLong): Acts as a volatility reference calculated over a longer period (default is 100 bars).
Relative Volatility Factor (RVF):

First, the standard deviation of the short-term ATR over a specified lookback period (default is 14 bars) is calculated.
The RVF is then computed using the formula:
RVF
=
1
+
(
stdev(atrShort, rvfLength)
atrLong
)
RVF=1+(
atrLong
stdev(atrShort, rvfLength)

)
The Dynamic ATR is derived by multiplying the short-term ATR by the RVF:
Dynamic ATR
=
atrShort
×
RVF
Dynamic ATR=atrShort×RVF
Plotting the Trend Levels:
Each level is determined by adding (for upper levels) or subtracting (for lower levels) a multiple of the Dynamic ATR from the Mid Line. For example, Level 1 is:

Level 1
=
Mid Line
±
(
1.0
×
Dynamic ATR
)
Level 1=Mid Line±(1.0×Dynamic ATR)
This calculation is repeated for up to 7 levels.

User Inputs
Mid Line Settings:

Period: Number of bars for the moving average (e.g., 100).
Type: Moving average type (Options: SMA, EMA, WMA, RMA, HMA, ALMA).
ATR Settings:

ATR Short Period (atrShortLength): Default is 14.
(Reflects current market volatility.)
ATR Long Period (atrLongLength): Default is 100.
(Serves as the volatility reference.)
RVF Lookback Period (rvfLength): Default is 14.
(Used to compute the standard deviation of the short-term ATR.)
ATR Method: Moving average type for ATR calculation (Options: SMA, EMA, WMA, RMA, HMA, ALMA).
Band Multiplier:

Base Multiplier (multBase): Sets the scaling factor for the trend levels (default is 1.0).
Display Options:

Toggle Levels 1 to 7: Option to show or hide each trend level.
Bar Offset: Shifts the plotted lines forward or backward by a specified number of bars.
How to Use
Add to Chart:
Copy and paste the Pine Script code into TradingView’s Pine Editor and add the script to your chart.

Configure Settings:
Adjust the input parameters (such as moving average periods, ATR settings, and band multiplier) to suit your trading style and the instrument being analyzed.

Interpret the Levels:

The Mid Line acts as the central trend indicator.
The plotted bands represent dynamic support and resistance levels that adjust based on recent volatility.
Wider bands indicate higher volatility; narrower bands suggest lower volatility.
Apply in Trading:
Use these dynamic trend levels to help identify potential entry and exit points, confirm trends, or set stop-loss levels. Always combine the indicator with other technical analysis tools and sound risk management practices.

Disclaimer
This indicator is provided for educational purposes only. It is not financial advice, and its performance is not guaranteed. Trading involves substantial risk, and you should use this indicator in conjunction with other forms of analysis and risk management techniques.

Note di rilascio
Redefining parameters by default to a better ADAPTIVE to all the crypto futures
Note di rilascio
Enhancing the scale to none

Declinazione di responsabilità