David Sepiashvili's article "Trend Quality Indicator" introduces two new
indicators; Q-indicator and B-indictor. Both can be added to MetaStock with the
formulas listed below.
To enter this indicator into MetaStock:
<li>In the Tools menu, select Indicator Builder.
<li>Click New to open the Indicator Editor for a new indicator.
<li>Type the name of the formula.
<li>Click in the larger window and type in the formula.
Name:
Q-indicator
Formula:
m:=Input("% Scalar trend period",1,25,4);
n:=Input("% Scalar noise
period",1,500,250);
cf:=Input("% Scalar correction factor",1,250,2);
p1:=Input("First moving average periods",1,200,7); p2:=Input("Second moving
average periods",1,200,15); rev:=Mov(C,p1,E)-Mov(C,p2,E);
pds:=If(rev>0,1,-1); dc:=ROC(C,1,$);
cpc:=If(pdsRef(pds,-1),0,(dc*pds)+PREV);
trend:=If(pdsRef(pds,-1),0,(cpc*(1/m))+(PREV*(1-(1/m))));
dt:=cpc-trend;
noise:=cf*Sqrt(Mov(dt*dt,n,S));
trend/noise
Name:
B-indicator
Formula:
m:=Input("% Scalar trend period",1,25,4);
n:=Input("% Scalar noise
period",1,500,250);
cf:=Input("% Scalar correction factor",1,250,2);
p1:=Input("First moving average periods",1,200,7); p2:=Input("Second moving
average periods",1,200,15); rev:=Mov(C,p1,E)-Mov(C,p2,E);
pds:=If(rev>0,1,-1); dc:=ROC(C,1,$);
cpc:=If(pdsRef(pds,-1),0,(dc*pds)+PREV);
trend:=If(pdsRef(pds,-1),0,(cpc*(1/m))+(PREV*(1-(1/m))));
dt:=cpc-trend;
noise:=cf*Sqrt(Mov(dt*dt,n,S));
temp:=If(Abs(trend)+Abs(noise)=0,1,Abs(trend)+Abs(noise));
(Abs(trend)/temp)*100;