Hi Guys,

Can someone please give me a hand with converting a metastock formula 
using PREVIOUS to Metastock. I believe I am supposed to be using a 
FOR loop to do it but am not sure where to start. I have been pointed 
to http://www.amibroker.com/guide/afl/afl_view.php?ama

and have also found a mentioned at the link below

http://www.mail-archive.com/[email protected]/msg11900.html

but still am not sure where to start. The formula is below. I dont 
want someone to do this for me but if they could give me a start I'd 
appreciate it.

//ATRMulti := Input("ATR multiplier:", 0, 99999, 2.8); 
//ATRPeriod := Input("Number of bars in ATR:", 1, 99999, 22); 

ATRMulti = 2.8;
ATRPeriod = 22;

AvPrc = (HIGH + LOW + CLOSE) / 3; 
calc = AvPrc - ATR(ATRPeriod ) * ATRMulti; 

If(Ref(CLOSE, -1) < PREVIOUS, calc, 
        If(calc > PREVIOUS, calc, 
                PREVIOUS))

Regards
Steve

Reply via email to