PureBytes Links
Trading Reference Links
|
It's still making an array because you are still using arrays in the
IIf...and IIf is an array function itself.
>From HELP:
SYNTAX iif( EXPRESSION, TRUE_PART, FALSE_PART )
RETURNS ARRAY
You can fix this with either:
if(LastValue(sf))
{
or
if(SelectedValue(sf))
{
However, this may not be what you want. Also you are always comparing to the
last bar for the Close.
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Gerald Monks
Sent: Saturday, January 27, 2007 19:36
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] What is wrong with this simple code?
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
|