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

Re: [amibroker] Code problems with 'if'



PureBytes Links

Trading Reference Links

Finalscore is array... if statement takes numeric

use lastvalue(finalscore) or
selectedvalue(finalscore)


----- Original Message ----- 
From: "McGuyVr70" <driek@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
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
> 
> 
> 
> 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
> 
> 
> 


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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/