The Max Deviation indicator calculates the maximum deviation between the high and low of the last N days, providing a measure of volatility over a specified time period. This indicator can be used to identify areas of support and resistance, as well as to assess the volatility of a financial instrument.
Configuring the Indicator
To configure the Max Deviation indicator, it is necessary to set the length parameter, which represents the number of days over which the maximum deviation will be calculated. The value of length can be adjusted according to the specific needs of the trader, for example, 10, 20, or 50 days, depending on the desired period of analysis.
calculates the maximum deviation between the high and low of the last N days, providing a measure of volatility over a specified time period. This indicator can be used to identify areas of support and resistance, as well as to assess the volatility of a financial instrument.
To configure the Max Deviation indicator, it is necessary to set the length parameter, which represents the number of days over which the maximum deviation will be calculated. The value of length can be adjusted according to the specific needs of the trader, such as 10, 20, or 50 days, depending on the desired analysis period.
Configuration Example
If you wish to configure the indicator for a 20-day analysis, change the parameter line as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// Impostazioni iniziali DEFPARAM DrawOnLastBarOnly = True DEFPARAM CalculateOnLastBars = 1000 // Parametro per il numero di giorni length = 10 // Calcolo del massimo e del minimo degli ultimi N giorni highMax = highest[length](high) lowMin = lowest[length](low) // Calcolo dello scostamento massimo maxDeviation = highMax - lowMin // Tracciare il risultato RETURN maxDeviation AS "Max Deviation" |
length = 20
This change will update the indicator to calculate the maximum deviation based on the last 20 days.
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials