[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Optimization Assistance Needed



PureBytes Links

Trading Reference Links

I've just started using MetaStock as an "upgrade" (I think) from Window 
on Wall Street and need some help with the optimization function in the 
system tester. I hope this doesn't seem like a "lazy" question, because 
I have looked for the answer in the manual and have tried various 
methods to no avail.

I'm trying to optimize a variable in a custom indicator - Perry 
Kaufman's Adaptive Moving Average. I would like to test for the optimal 
lookback period ("Periods"). I have pasted the formula for the AMA 
below. Any assistance is much appreciated.

Periods := Input("Time Periods",1,1000, 10);

Direction := CLOSE - Ref(CLOSE,-periods);

Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);

ER := Abs(Direction/Volatility);

FastSC := 2/(2 + 1);

SlowSC := 2/(30 + 1);

SSC := ER * (FastSC - SlowSC) + SlowSC;

Constant := Pwr(SSC,2);

AMA := If(Cum(1) = periods +1, Ref(CLOSE,-1) + constant * (CLOSE - 
Ref(CLOSE,-1)),PREV + constant * (CLOSE - PREV));

AMA

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com