[amibroker] How to handle logical situations?

 

   
1) When referring previous 15th bar, then bar numbers less than 15 will have Null values and show error.

So, do we use nz() in that case?

2) divisor as 0:

Trend_Time_R2_S =  (nom_S / denom_S ) ^ 2;

Error: Warning 505: Divisiot by Zero. Divisor array at [21] is equal to zero.

What is the best way to fix it?

3) Calculating market cap ROC within a vertical selector range:

Period_Selected = EndValue( BarIndex()    )  - Nz(BeginValue( BarIndex() ));
Market_Cap_ROC_S = ROC(Market_Cap_S , Nz(abs(Period_Selected)));

Error: Error 52, Invalid argument value for ROC() function. Range must be greater than zero (and not Null).


__._,_.___

Posted by: meanomalist@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon