This indicator is made of the classical Donchian Channel, but the upper and lower are factorized by the Average True Range of recent periods (pd value). The trend revert is “activated” when the close crossed above or below the upper or lower line.
////DONCHIAN CHANNEL ACTIVATOR///
///VARIABLE
//pd = 5
//ot = 1
//Factor = 1
hi = HIGHEST[pd](high)[ot]
lo = LOWEST[pd](low)[ot]
DUpper=hi+Factor*AverageTrueRange[pd](close)
DLower=lo-Factor*AverageTrueRange[pd](close)
if f=1 then
if close<lo then
f=-1
c=DUpper//hi
else
c=DLower//lo
endif
else
if close>hi then
f=1
c=DLower//lo
else
c=DUpper//hi
endif
endif
return c coloured by f as"donchian activator"