Hi Dawsonsg,
 
Can you explain what you're trying to achieve? Does the PREVIOUS function 
refers to the previous value in the array? I would be happy to help.
 
 
Regards,
 
Amit Ehrenreich
Market Testing Wizards
www.markettestingwizards.com

________________________________

From: [email protected] on behalf of dawsonsg
Sent: Fri 3/21/2008 5:14 PM
To: [email protected]
Subject: [amibroker] Help with PREVIOUS function



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 
<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 
<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



 

<<winmail.dat>>

Reply via email to