It fails not because it's an array, but because you cast it as a numeric by using if()
This works: CheckReady = IIf(ADX(period) >= 20,1,0); //Result contains True or False for every bar of data in the database Most things in AB are arrays since it computes the values of all bars of data all at once. That's one reason AB is so fast. If you want to access individual bars of data you can do this with loops and array subscripts[bar], and these values are all numeric since you are referring to a single element of the array. -- Terry -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of murthysuresh Sent: Tuesday, March 14, 2006 20:01 To: [email protected] Subject: [amibroker] why is formula results stored in array I dont understand one fact. CheckReady = if(ADX(period) >= 20) this fails becasue the adx is returned as a array and not a number. 1. Why is the return value of the Adx function stored as a array. i would expect the result to be a decimal number. 2. What is the best way to cast the array as a number? ------------------------ Yahoo! Groups Sponsor --------------------~--> Try Online Currency Trading with GFT. Free 50K Demo. Trade 24 Hours. Commission-Free. http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM --------------------------------------------------------------------~-> 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 Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/amibroker/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
