How to define whether a parameter is empty due to lack of data

Hi Everyone,

I recently started implementing larger time frames in my coding and have come upon an issue of some stocks having not enough data for certain parameters.

An example is below

I was wondering how i could code the parameter to ignore when there is an empty space, rather than displaying a false signal. E.G there should be purple circles between 2006 to 2007 but since there is indicator is empty it is not placing those circles.

i was thinking of using an iff function but dont know how to define the empty area.

Cheers fellas.

Hi
You can use IsEmpty() function
https://www.amibroker.com/guide/afl/isempty.html

But if your code is more complex there is another technic with BarCount

 Mycontition = CCI(14);
NotEmpty = iif( IsEmpty(Mycontition),1,0 ); 
Title = "NotEmpty "+NotEmpty;
1 Like

@PanoS,
checkl out https://www.amibroker.com/guide/afl/nz.html

Mycontition = CCI(14);
NotEmpty = Nz(Mycontition , 1); 
Title = "NotEmpty "+NotEmpty;
2 Likes

Cheers Fellas, work out perfectly appreciate it.