Accessing element in an array?

#1
I am evaluating RSI using the following statement in Amibroker AFL

r=RSI(14);
long=cross(r,30);

Cross function returns an array. Now my question is can i access the individual array element(in long). If so how can i do it?

Thanks in advance.

Ashok
 

asnavale

Well-Known Member
#2
I am evaluating RSI using the following statement in Amibroker AFL

r=RSI(14);
long=cross(r,30);

Cross function returns an array. Now my question is can i access the individual array element(in long). If so how can i do it?

Thanks in advance.

Ashok
Hi Ashok,

Cross function returns only True (1) or false (0). Therefore, the long in above afl contains only 0s and 1s. The value is 1 immediately after (or at the cross-over) and all other values are zero.

You can access the individual elements of long by using long.

-Anant
 
#3
Thanks for your reply anant.

If i am trying to access the individual element in long like long am not getting the desired results.Say for instance i want to check each and every element in long and then i want plot Long based on some other conditions. When i am doing so it is not plotting at the appropriate places instead it is plotting long in every candle on the entire chart.
 

Similar threads