We may express Close as a function of MA or EMA or DEMA with the
// Inverse functions, by D. Tsokakis, Aug 2003
p=20;fp=2/(p+1);
CloseviaMA=p*MA(C,p)-(p-1)*Ref(MA(C,p-1),-1);// [1]
CloseviaEMA=0.5*((P+1)*EMA(C,P)-(P-1)*Ref(EMA(C,P),-1));// [2]
CloseviaDEMA=(DEMA(C,p)+(1-fp)*fp*Ref(EMA(C,p),-1)-(1-fp)*Ref(DEMA(C,p),-1))/((2-fp)*fp);// [3]
Plot(C,"CLOSE",1,1);
Plot(CloseviaMA,"CloseviaMA",5,1);
Plot(CloseviaEMA,"CloseviaEMA",7,1);
Plot(CloseviaDEMA,"CloseviaDEMA",4,1);
It is obvious that [1], [2] and [3] are independent of the smoothing period p, they are all equal to Close.
See also
http://www.amibroker.com/library/detail.php?id=286
http://groups.yahoo.com/group/amibroker/message/45801
// Inverse functions, by D. Tsokakis, Aug 2003
p=20;fp=2/(p+1);
CloseviaMA=p*MA(C,p)-(p-1)*Ref(MA(C,p-1),-1);// [1]
CloseviaEMA=0.5*((P+1)*EMA(C,P)-(P-1)*Ref(EMA(C,P),-1));// [2]
CloseviaDEMA=(DEMA(C,p)+(1-fp)*fp*Ref(EMA(C,p),-1)-(1-fp)*Ref(DEMA(C,p),-1))/((2-fp)*fp);// [3]
Plot(C,"CLOSE",1,1);
Plot(CloseviaMA,"CloseviaMA",5,1);
Plot(CloseviaEMA,"CloseviaEMA",7,1);
Plot(CloseviaDEMA,"CloseviaDEMA",4,1);
It is obvious that [1], [2] and [3] are independent of the smoothing period p, they are all equal to Close.
See also
http://www.amibroker.com/library/detail.php?id=286
http://groups.yahoo.com/group/amibroker/message/45801