{ TSMDoubleSmoothing: Simple double smoothing of closing prices
  Copyright 1999, P.J.Kaufman. All rights reserved. }

	input:	price(numericseries), length1(numericsimple), length2(numericsimple);
	var:	avg(0), davg(0);

	avg = smoothedaverage(price,length1);
	davg = davg[1] + (2 / (length2 + 1))*(avg - davg[1]);
	TSMDoubleSmoothing = davg;