//see article C. Kase – Accounting for volatility variance and skew in managing trading risk
//calcutating true range of double bar
H=MAX(high,high[1])
L=min(low,low[1])
fact1=abs(close[2]-H)
fact2=abs(close[2]-L)
Range2=abs(H-L)
max10=max(range2,fact1)
max11=max(range2,fact2)
TR2=max(max10,max11)
//moving average of double bar true ranges
MVATR=Average[n](TR2)
//standard deviation of true ranges
SDEV=STD[n](TR2)
//dev stop reversal value
DDEV=MVATR+f*SDEV
///calcoli dei devstop I
DevStLong=high-DDEV
DevStShort=low+DDEV
RETURN DevStlong coloured (200,0,200) as “DevStLong”, DevStShort coloured (200,100,0) as “DevStShort”
***
Important: factor f is decimal
Useful for determing next day stops ofr shares and commodities (not very useful with indexes) – see also highs, lows and Bollinger Bands