The following Code of a moving average is published in a bulletin board by Andreas Uhl.
I canĀ“t "read" a Metastock Code. Is it possible to code this in eSignal efs?
Thank You!
Helmut
{Corrected Average (CA), A.Uhl, Oct. 25, 2005}
vars:
CA(0),SA(0),n(0),
v1(0),v2(0),K(0);
inputs:
Price(Close),length(35);
if CurrentBar=1 then
CA=Price
else
begin
if CurrentBar<length then
n=CurrentBar
else
n=length;
SA=Average(Price,n);
v1=Square(StdDev(Price,n));
v2=Square(CA[1]-SA);
if v2<v1 then
K=0
else
K=1-v1/v2;
CA=CA[1]+K*(SA-CA[1]);
end;
Plot1(CA,"Corrected Average",Red,White,3);
Plot2(SA,"Simple Average",Blue,White,1);
I canĀ“t "read" a Metastock Code. Is it possible to code this in eSignal efs?
Thank You!
Helmut
{Corrected Average (CA), A.Uhl, Oct. 25, 2005}
vars:
CA(0),SA(0),n(0),
v1(0),v2(0),K(0);
inputs:
Price(Close),length(35);
if CurrentBar=1 then
CA=Price
else
begin
if CurrentBar<length then
n=CurrentBar
else
n=length;
SA=Average(Price,n);
v1=Square(StdDev(Price,n));
v2=Square(CA[1]-SA);
if v2<v1 then
K=0
else
K=1-v1/v2;
CA=CA[1]+K*(SA-CA[1]);
end;
Plot1(CA,"Corrected Average",Red,White,3);
Plot2(SA,"Simple Average",Blue,White,1);
Comment