Risk warning

All articles, strategies and indicators are just reflecting a single traders opinion and should be viewed as that.
I advice everybody to trade with a DEMO account!

Sunday, May 15, 2011

The advance decline line indicator (A/D line).

The advance decline line (A/D line) is an indicator that shows us the strength of a trend. The advance decline indicator is calculated in the following way:

A/D line = (number of up bars – number of down bars) + previous A/D value

The indicator is also used by stock traders in a similar way:

A/D line = (number of stocks up – number of stocks down) + previous A/D value

The advance decline indicator not only indicates if a trend is strong or weak but also when a trend unhealthy. If the market is going up and the A/D line is going up we have a strong uptrend. When the market is going down and the A/D line is going down we have an strong downtrend.

When the A/D line is going up but the prices are going down, the trend is unhealthy. This is also called divergence. This means there is a possible reversal of the market on his way. Same when the A/D line is going down but the prices are going up. Again this is divergence between the A/D line and the actual price evolution.

If you use a big value for the period the divergence is only important if it last long enough. That is because the bigger the period you use the more the indicator will be lagging. Lagging is a term used in trading to indicate an indicator is running behind. The more an indicator lags the more dangerous there is to use its signals. The danger is that you trade on a signal that indicates a market condition that has already passed. In the worst case for example you can see a buy signal when the market is already in a downtrend. The lagging of any indicator is not harmful in trends that hold for a long period of time.

Below you see a screen shot of the advance decline indicator.

The code for the indicator:

indicator AD_line;
/*written by ctlprogrammer*/
/*Warning for demonstration purpose only, no live trading please*/
/*you can freely copy the code but plz leave this header*/
/*http://ctltrading.blogspot.com*/
input period=3;
draw adline("line");
begin
integer i,j,p;
number count;
integer f := front(close);
integer b := back(close);
adline:=makeseries(f,b,0);
p:=period;
for i:=f+p to b do
begin
  count:=0;
  for j:=0 to p-1 do
  begin
  if close[i-j]>open[i-j] then count:=count+1;
  if close[i-j]<open[i-j] then count:=count-1;
  end;
adline[i]:=count+adline[i-1];
end;
end.


This indicator should not be confused with the accumulation distribution line. The accumulation distribution line indicator is an indicator that relates the prices changes with the change of volume.


No comments:

Post a Comment