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

[amibroker] Re: problem with formula/ or scan test



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanag@xxxx> wrote:
> Goldwing,
> 
> Isn't there something conflicting in the following line:
> 
> buy=Cross(Close,O > H-(H-L)*.25 AND C > H-(H-L)*.25 AND
> L<Ref(LLV(L,10),-1));
> 
> The line:
> O > H-(H-L)*.25 AND C > H-(H-L)*.25 AND L<Ref(LLV(L,10),-1)
> 
> I believe returns a ( 1 ) for true and ( 0  ) if not true....
> 
> Anthony
> 

 Here is a suggestion when writing code to be sure the parts
are executed in the order you would like. Each function should be
enclosed in brackets such as buy=Cross(Close,(O > (H-(H-L))) then
each function is executed in order. This especially holds for each
side of an AND statement. It is very easy to write code that does
not execute in the order expected. By adding brackets you can 
be sure this does not happen.

                                  Cliff s



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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