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

Re: [amibroker] Re: AFL formula question



PureBytes Links

Trading Reference Links



Lars --
Mike's suggestion is fine.  However, he failed to point out two significant programming errors which you made.
for Try 1: Filter = RSI(14) > 30 AND RSI(14) > HHV(RSI(14),1);,
RSI(14) > HHV(RSI(14),1) can never be true because HHV() includes value of present bar.

for Try 2: Filter = RSI(14) > 30 AND RSI(14) > (RSI(14),1);,
RSI(14) > (RSI(14),1) is meaningless (and in editor's syntax check should have caught it).
You probably meant
RSI(14) > Ref(RSI(14),1)

I'm guessing that either try1 or 2 would work, if coded error free, though much less efficient than Mike's suggestion.
-- Keith



Mike wrote:

See the Ref function:
http://www.amibroker.com/guide/afl/afl_view.php?name=ref

Note that it is better to store the result of a function call and reuse it, rather than repeatedly executing the same function call over and over again. Try something like:

RSI14 = RSI(14);
Filter = RSI14 > 30 AND RSI14 > Ref(RSI14, -1);

Mike

--- In amibroker@xxxxxxxxxps.com, "larssa11" <larssa11@xx.> wrote:
>
> Hi,
>
> I'm quite new to using Amibroker and trying to learn by typing some formulas.
>
> One thing I can't get to work as I want is to filter that a certain value should be higher than a certain value and also higher then yesterday.
>
> For instance:
> Filter that RSI (14) is higher then 30 and also higher then the day before.
> I guess this is very simple but I just can't get it to work.
>
> The objective of the formula is to filter out that the RSI value is pointing upward.
>
> I've tried the following:
>
> Try 1: Filter = RSI(14) > 30 AND RSI(14) > HHV(RSI(14),1);
> Try 2: Filter = RSI(14) > 30 AND RSI(14) > (RSI(14),1);
>
> But that doesn't work..
>
> Is there anyone who can have a quick look and tell me what's wrong ?
>
> Thanks, Lars
>



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___