Corrected Average indicator by A.Uhl (also known as the “Optimal Moving Average“).
The strengths of the corrected Average (CA) is that the current value of the time series must exceed a the current volatility-dependent threshold, so that the filter increases or falls, avoiding false signals in trend is weak phase.
– by Prof. A.Uhl –
This moving average have the advantage to avoid some whipsaws. It can also act as support and resistance line.
//parameters :
// length = 35
if(barindex>length) then
n=length
SA = average[n](close)
v1 = SQUARE(STD[n](close))
v2 = SQUARE(CA[1]-SA)
if(v2<v1) then
k=0
else
k=1-v1/v2
CA=CA[1]+K*(SA-CA[1])
endif
endif
RETURN CA as "corrected moving average"