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

RE: [amibroker] Example code doesn't work



PureBytes Links

Trading Reference Links

Thanks for taking a look at it. It works now.


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Paul Ho
Sent: Montag, 6. März 2006 10:41
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Example code doesn't work

the for statement is wrong.
try i < barcount instead


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of metaboxfan
Sent: Monday, 6 March 2006 8:32 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Example code doesn't work

Hi

Sorry for asking. In the code below, which I got from Common Coding mistakes I

neither see red nor green colors in my plot but I do see a gray plot.

What is wrong with this simple code?

Thanks in advance

Olli

/*

From: Common Coding mistakes in AFL

Example: if-else statement needs boolean (or single numeric expression), not array

Re: [Amibroker] Creating a toggle switch Sent: 27.06.2005

*/

_SECTION_BEGIN("ShowEarnings_1");

Color[0] = colorGreen;    // if I don't add this line I'll get Error 29, Variable 'color' used without having been initialized

  

for (i=0; i > BarCount; i++)

{

if (Close[i] > Open[i] )

Color[i] = colorGreen;

else

Color[i] = colorRed;

}

Plot(Close,"Colored Price", Color, styleCandle);

_SECTION_END();



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 other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS