Have a look in the MS Users Manual for the envelope indicator. This functionality has already been programmed for you.
If you want to learn how to program this yourself, then try something along these lines:
|
prd:=10; data:=CLOSE; coeff:=0.001;
ma:=Mov(data, prd, E); ul:=ma*(1+coeff); ll:=ma*(1-coeff);
{plot} ul; ma; ll; |
As Dr Elder said in his book, you will have to play around with the coefficient value to "fit" the envelope around the data.
Hope this helps.
wabbit
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
For custom MetaStock programming : http://www.wabbit.com.au
My SkyPE status : 
My SkyPE account : wabbit.com.au