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

[amibroker] Help with PREVIOUS function



PureBytes Links

Trading Reference Links

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/amibroker@xxxxxxxxxxxxxxx/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


------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/