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

Re: [amibroker] Code problems with 'if'



PureBytes Links

Trading Reference Links

Yes scalar is just a single number (as opposed to array of numbers)

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: James
Sent: Wednesday, March 28, 2007 3:08 PM
Subject: Re: [amibroker] Code problems with 'if'

What is a scalar? It is mentioned more frequently on this list. A search of the users guide returns 1 instance and basically says it is a number.

----- Original Message ----
From: Graham <kavemanperth@xxxxxxxxx>
To: amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, March 27, 2007 8:40:17 PM
Subject: Re: [amibroker] Code problems with 'if'

There was a recent discussion regarding this, in fact many discussions
IF is primarily used within loops where you are doing array analysis
Outside of the loops IIF is easier to use for assigning values to variables based on array or scalar conditions
IF in normal AFL can only be used for a scalar value condition, not for array conditions


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


On 28/03/07, Alain Baur <alain.baur@xxxxx internet. fr> wrote:
I had the same problem with "if", it seems to me (but not sure)  that the condition of the if must be  "=" all others conditions give an error (< > <= >= .....)
 
----- Original Message -----
From: cstrader
Sent: Tuesday, March 27, 2007 7:09 PM
Subject: Re: [amibroker] Code problems with 'if'

Finalscore is array... if statement takes numeric

use lastvalue(finalscor e) or
selectedvalue( finalscore)

----- Original Message -----
From: "McGuyVr70" <driek@xxxxxx com>
To: < amibroker@xxxxxxxxx ps.com>
Sent: Tuesday, March 27, 2007 11:43 AM
Subject: [amibroker] Code problems with 'if'

>I am stumped as to why the 'if' statement does not work. Prev_Close
> should only be a single number, the previous days close.
>
> Prev_Close = TimeFrameGetPrice( "C", inDaily, -1 ); // Previous day's
> close
> FinalScore = round((Prev_ Close / ChannelHigh) * 100);
> if ( FinalScore < 55 ) // error 6 on this line
> {
> }
>
> The 'if' statement fails. I believe the cause is the Prev_Close, it is
> an array and the 'if' statement can not process arrays. How can I make
> the 'if' statement work? What do I need to change to allow the 'if'
> statement to make this work?
>
> Thanks
>
> Dan





Never miss an email again!
Yahoo! Toolbar
alerts you the instant new Mail arrives. Check it out.
__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___