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

[amibroker] Re: Some strange addition rules



PureBytes Links

Trading Reference Links

Tomasz,
thank you for details.
I understand that you follow some convention NULL+X=NULL.
I am not sure it reflects the common addition logic.
Nz solves the alternative.
Some clarification of the use of the above convention would not be a 
bad idea for the AFL reference.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Dimitris,
> 
> The {empty} ( or  Null) in AmiBroker works as NULL in the databases.
> 
> When any part of arithmetic expression is NULL the entire 
expression becomes NULL.
> Null (empty) means in fact "UNKNOWN" 
> If you add 2 + UNKNOWN the result is still UNKNOWN.
> 
> For example for the first 20 bars the value of MA( Close, 20 ) is 
UNKNOWN (empty).
> 
> As for DB examples see:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/off2000/html/acconCalcControlExpUseArithmeticOperators.asp
> 
> 
> AB 4.29.8 features new function Nz
> http://www.amibroker.com/guide/afl/afl_view.php?name=NZ
> 
> that allows to easily convert Null (empty) to zero:
> 
> Nz( Foreign("RATL","O") ) + Nz( Foreign("CSCO","O") )
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
>   ----- Original Message ----- 
>   From: Dimitris Tsokakis 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Thursday, March 06, 2003 11:37 AM
>   Subject: [amibroker] Some strange addition rules
> 
> 
>   I noticed that
>   {empty}+X={empty}
>   X+{empty}={empty}
>   One should expect {empty}+X=X.
>   Consequently, special care should be taken with similar additions 
[or subtractions, multiplications, divisions]
>   If you try to add Foreign("RATL","O")+Foreign("CSCO","O") and the 
RATL data is missing for a certain bar, the result would be {empty}
>   instead of the expected Foreign("CSCO","O") 
>   Dimitris Tsokakis
> 
>         Yahoo! Groups Sponsor 
>               ADVERTISEMENT
>              
>        
>        
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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 the Yahoo! Terms of 
Service.


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/