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

Re: [amibroker] equivalent of PREV



PureBytes Links

Trading Reference Links

Someone posted this awhile ago. Might be of help to you.
As for MS PREV function, look up the AMA/AMA2 function on the Amibroker list. There's 
quite a number of explanations re: PREV

HaClose = (O+H+L+C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), colorBlack, 64);

----- Original Message ----- 
From: "Zeno" <lars.oppermann@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, January 11, 2005 9:11 AM
Subject: [trading] [amibroker] equivalent of PREV


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




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/