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

Re: [amibroker] Why I find AFL painful to uee



PureBytes Links

Trading Reference Links

It can be frustrating at first to get a handle on the ways computer
programs work. But worth the battle

To start with IF is (as I ahve explained in previous emails here) is
for use with arrays within a Loop, or for static value variables which
are the same value regardless of bar.

This is why you cannot use an array like H1 with IF unless you place
it inside a FOR loop
Also strings cannot be array based, so you cannot use them based on
array values for use in analysis.

If all you want is to explore and show the "H' or "L" in the column
then try this

AddColumn( IIf( H1, Asc("H"), IIf( L1, Asc("L"), Asc(""))), "Signal",
formatChar );


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriting.com




On 25/04/07, Homar Simpson <x77777x@xxxxxxxxx> wrote:
>   I am also an experienced programmer of many years. Too many probably.
>
>   I have worked with many languages and assembler, but mostly with
> structures where  the power was in the code not the language. So what
> you saw on the page told you what was going on.  Mostly.
>
>   The real problem I have is the constant battle with array type, and
> the refusal to allow the simplest comparisons.
>
>   Heres an example
>
> WeeksBack = Param("Weeks Back", 52, 1, 520, 1 );
> HighOrLow ="";
>
> H1 = High > Ref(HHV(High,WeeksBack*7),-1);
> L1 = Low < Ref(LLV(Low,WeeksBack*7),-1);
>
> if (H1==1)
>  HighOrLow = "H";
>
> if (L1==1)
>  HighOrLow = "L";
>
> Filter = H1 OR L1;
>
> AddTextColumn( FullName(), "Full name", 77);
>  AddColumn(H1 ,"High",3);
>  AddColumn(L1 ,"Low",3);
> AddColumn(Close,"Close",1.4);
> AddColumn(Volume,"Volume",1.0);
>
>
>
>   The problem is , AFL will not let me test for
>  H1==1 or H1==TRUE, complaining that H1 is an array.  I tried a number
> of things to convert it to a non array, but failed.
>
>  When you output H1 in a column, it is a 1 or a 0.
>
>  This is the 'nastiness' I referred to.  I'm sure theres a solution,
> and probably an easy one, but it is non obvious to me.
>
>
>


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/