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

Re: [amibroker] How may I write a "if condition" depend on the BarIndex() ?



PureBytes Links

Trading Reference Links

xx=WriteIf(BarIndex()>5,"barindex > 5","Not");

Title=xx;

----- Original Message -----
From: tintin92
Sent: Thursday, December 23, 2004 9:17 AM
Subject: [amibroker] How may I write a "if condition" depend on the BarIndex() ?

Hi,

The code following dont works.
How may I write a "if condition" depend on the  BarIndex() ?

Thanks.

Tintin92


Code :
-------------------------------------------------------
if (BarIndex() > 5)
{
"BarIndex is greater than 5.";
}
Plot(C,"close", colorBlack, styleCandle);

Error
-------------------------
Error 3.
Condition in IF, WHILE, FOR statements
has to be Numeric or Boolean type.
You can not use array here,
please use [] (array subscript operator)
to access array elements


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html




No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.0 - Release Date: 12/17/2004


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.4 - Release Date: 12/22/2004