Obrigado Herbert, acho que vi esses vídeos, são muito bons. Acabei me virando com um meia boca que criei e que funcionou.
abs
var
media,maxval,minval:float ;
tf,tff :integer;
begin
tf:=ceiling(120/graphicoffset());
tff:=ceiling(55/graphicoffset());
se (time =1055) then
begin
maxval:= highest(high,tf);
minval:= lowest(low,tf);
end;
if (graphicinterval=1) then
begin
se (time =1059) then
begin
maxval:= highest(high,tf);
minval:= lowest(low,tf);
end;
end;
se (time =1255) then
begin
maxval:= highest(high,tf);
minval:= lowest(low,tf);
end;
se (time =1455) then
begin
maxval:= highest(high,tf);
minval:= lowest(low,tf);
end;
se (time =1655) then
begin
maxval:= highest(high,tf);
minval:= lowest(low,tf);
end;
se (time =1755) then
begin
maxval:= highest(high,tff);
minval:= lowest(low,tff);
end;
media:=(((maxval+minval)/2) + (AdaptiveMovingAverage(20,2,30)) )/2;
plot(maxval);
plot2(minval);
end;