That works fine for me. What error is it giving? You don't need the two sets of brackets in the "c1 = ..." statement though.
Regards, GP --- In [email protected], "lifes_student_1" <[EMAIL PROTECTED]> wrote: > > Thanks. Why can't I do the following though that should result in a > boolean: > > color = colorLime; > color2 = colorRed; > i1 = colorLime; > c1 = ((i1 == color OR i1 == color2)); > if (c1 == true) > {... > > > This doesn't work. I guess I'm not used to AFL. > > > > --- In [email protected], "Thomas Z." <tzg@> wrote: > > > > You need a loop and then you could write if(barsback[i] < 6) > > > > The other way would be to use IIF() > > > > Regards > > Thomas > > www.patternexplorer.com > > > > > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > On Behalf > > Of lifes_student_1 > > Sent: Saturday, August 25, 2007 8:28 PM > > To: [email protected] > > Subject: [amibroker] getting an error in my if statement > > > > condition1 = cross(close, ma(close,20)); > > barsback = BarsSince(condition1 == true); > > if(barsback < 6) > > {... > > > > I'm getting error 6 on barsback in if statement. condition1 is set > and > > works as I've tested it elsewhere. What am I doing wrong? > > > > (Condition in IF, WHILE, FOR statements has to be Numeric or > Boolean > > type. You cannot use an array here....) > > >
