This indicator calculates the volatility and amplitude of the price.
Its use can be useful for three reasons
Knowing volatility
To know the amplitude of price movements
To know the relationship between the two
The most important function of this indicator is reporting.
The ratio is simply the difference between the amplitude and the volatility, if the amplitude, i.e. the average movements are smaller than the volatility, then the price is in a phase of stagnation.
This way, if you are trading multiple markets, taking the one that gives the best ratio will benefit your portfolio!
The second function that I say “useful” and not important is volatility, in fact knowing the volatility is very useful to position stop loss protection.
And finally the amplitude, which is nothing more than information.
So to put it simply, if the report is negative, not trading is the best idea!
If you are trading forex, you will need to check the external variable “Forex”.
IV
//
//=/===============/=//=/===============/=//=/ Indicator Range Trend
//
defparam drawonlastbaronly = true
//
//=/===============/=//=/===============/=//=/ Range Fast
//
once FxRRange=close
Fxscale = 2.338*average[14,1](abs(close-close[1]))
FxR = average[27,1](FxScale)
FxHH = close
FxLL = close
if FxHH > FxRRange[1] then
if (FxHH-FxR) < FxRRange[1] then
FxRRange = FxRRange[1]
else
FxRRange = (FxHH-FxR)
endif
elsif (FxLL+FxR) > FxRRange[1] then
FxRRange = FxRRange[1]
else
FxRRange = (FxLL+FxR)
endif
FxTrend = FxRRange
FxURange = FxRRange + FxR
FxDRange = FxRRange - FxR
//
//=/===============/=//=/===============/=//=/ Range Low
//
once LxRRange=close
LxR = 2.338*average[14,1](abs(close-close[1]))
LxHH = high
LxLL = low
if LxHH > LxRRange[1] then
if (LxHH-LxR) < LxRRange[1] then
LxRRange = LxRRange[1]
else
LxRRange = (LxHH-LxR)
endif
elsif (LxLL+LxR) > LxRRange[1] then
LxRRange = LxRRange[1]
else
LxRRange = (LxLL+LxR)
endif
LxTrend = LxRRange
LxURange = LxRRange + LxR
LxDRange = LxRRange - LxR
//
//=/===============/=//=/===============/=//=/ Trend Line
//
//=/ Trend Line
TLr = (FxTrend+LxTrend)/2
AvTrD1 = (TLr+TLr[1])/2
AvTrD2 = (AvTrD1-TLr)/15
TrDL = AvTrD1-AvTrD2
//=/ Up Range
XURange = (FxURange+LxURange)/2
//=/ Dw Range
XDRange = ((FxDRange+LxDRange)/2)
//
//=/===============/=//=/===============/=//=/ Volatility & Amplitude Settings
//
//=/ Decompte Haussier
UAmp = 0
if close > TrDL then
UAmp = UAmp[1]+1
endif
//=/ Decompte Baissier
DAmp = 0
if close < TrDL then
DAmp = DAmp[1]+1
endif
//=/ Decompte Global
Amp = UAmp+DAmp
if Amp < Amp[1]-1 then
Amp = Amp[Amp]-Amp
endif
VRange = 0
if TrDL = TrDL[1] then
VRange = VRange[1]+1
endif
//=/ Decompte Amplitude
OAmp = (Amp-VRange)-VRange
if OAmp < 0 then
OAmp = 0
endif
if OAmp < OAmp[1]-1 then
OAmp = OAmp[1]-1
endif
if OAmp > OAmp[1]+1 then
OAmp = OAmp[1]+1
endif
//=/ Decompte final
if VRange > OAmp then
OAmp = VRange
endif
P = round(OAmp)
if forex then
//=/ Volatility
Volatilite = (((XURange*0.5)-(XDRange*0.5))*10000)
XV = round(Volatilite)
drawtext(" #XV# Volatility",barindex[1],TrDL[1]+(XURange[1]-TrDL[1]),Dialog,Bold,12) coloured(0,0,0)
//=/ Amplitude
if close > TrDL then
Amplitude = (close-Lowest[P](low))*10000
elsif close < TrdL then
Amplitude = (Highest[P](high)-close)*10000
endif
XA = round(Amplitude)
drawtext(" #XA# Amplitude",barindex[1],TrDL[1]+((XURange[1]-TrDL[1])/2),Dialog,Bold,12) coloured(0,0,0)
//=/ Rapport
RPP = (Amplitude-Volatilite)
XR = round (RPP)
if RPP > 0 then
drawtext(" #XR# Report",barindex[1],TrDL[1],Dialog,Bold,12) coloured(0,0,0)
elsif RPP =< 0 then
drawtext(" #XR# Report",barindex[1],TrDL[1],Dialog,Bold,12) coloured(199,19,19)
endif
else
//=/ Volatility
Volatilite = ((XURange*0.5)-(XDRange*0.5))
XV = round(Volatilite)
drawtext(" #XV# Volatility",barindex[1],TrDL[1]+(XURange[1]-TrDL[1]),Dialog,Bold,12) coloured(0,0,0)
//=/ Amplitude
if close > TrDL then
Amplitude = close-Lowest[P](low)
elsif close < TrdL then
Amplitude = Highest[P](high)-close
endif
XA = round(Amplitude)
drawtext(" #XA# Amplitude",barindex[1],TrDL[1]+((XURange[1]-TrDL[1])/2),Dialog,Bold,12) coloured(0,0,0)
//=/ Rapport
RPP = (Amplitude-Volatilite)
XR = round (RPP)
if RPP > 0 then
drawtext(" #XR# Report",barindex[1],TrDL[1],Dialog,Bold,12) coloured(0,0,0)
elsif RPP =< 0 then
drawtext(" #XR# Report",barindex[1],TrDL[1],Dialog,Bold,12) coloured(199,19,19)
endif
endif
return