Corrected Moving Average

Category: Indicators By: Nicolas Created: December 26, 2015, 3:45 PM
December 26, 2015, 3:45 PM
Indicators
2 Comments

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"

 

Download
Filename: Corrected-Moving-Average.itf
Downloads: 141
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...