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

Re: [amibroker] What is wrong with this simple code?



PureBytes Links

Trading Reference Links

I would have to assume that av, mv, pl and ph are arrays
Be careful using barcount unless you ahve also used the statement
setbarsrequired to ensure enough bars are loaded if charting
Instead of c[barcount-1] you are much better off using lastvalue(c)

Is there any reason why you are using the If(sf)? can it be without
resorting to this.
If you cannot just use
sf = lastvalue(av > mv AND C >= pl AND C <= ph);
then you will need to assume the sf stays as array and you need to
incorporate the if(sf[i]) into a for loop

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



On 28/01/07, Gerald Monks <glmonks@xxxxxxxxx> wrote:
> sf = IIf(av > mv AND Close[BarCount - 1] >= pl AND Close[BarCount - 1]
> <= ph, 1, 0);
>
> if(sf)
>   {
>   statements...
>   }
>
> I'm getting the dreaded Error 6. The if condition should not be
> receiving an array pointer, only the "0" or "1" numeric value. It's
> getting really tiresome dancing around the if statement in AFL to make
> things work. I'm finding the if statement pretty much useless.
>
> Any suggestions?
>
> Thanks
>
>
>
>
> 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
>
>
>
>

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.12/653 - Release Date: 1/26/2007 11:11 AM