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

[amibroker] equivalent of PREV



PureBytes Links

Trading Reference Links


Hi,

is there an equivalent to MetaStock's PREV variable, which allows to
reverence an earlier value of an array while it is being defined? Or
what would be the apropriate AFL concept to achive a similar behaviour?

E.g.:
I'd like to calculate  Heikin Ashi O/C/H/L values. HAOpen for instance
is defined as
HaClose(t) = (O+H+L+C)/4;
HaOpen(t) = (HaOpen(t-1) + HaClose(t-1))/2;

using Ref(HaOpen,-1) does not work, since HaOpen is undefined at this
time, Ref(HaClose,-1) is fine, since it was defined previously.

In MetaStock, one would write:
HaOpen:=(PREV + Ref(HaOpen,-1)/2;

What's the right way to do this in AFL?

Thanks for your support.
~Lars





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

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