A question about three code lines

Hello guys.

I'm not sure if I understand that three following code lines. Can anyone of you tell me if I'm right?

Delisting = GetFnData("DelistingDate");
ThisIsLastBar = BarIndex() == LastValue( BarIndex() ); 
 Cond = IIf( IsNull(delisting), 1, DateTime() < delisting);

the first line, create an array that contains the data for deslisted stocks.
the second line gets the value of the last bar. I'm not very sure about what means.... last trading day???
the third line creates an array named Cond, and inside this array places the result of this if condition.

then I should confess that I do not understand what happends into the array condition...:disappointed_relieved:

What does datatime? Something about format?!?!

If format is less than deslisted then the deslisted data are not good???

All it's pretty confused to me.

Wrong, variable delisting is of type number and holds a datetime value. It reads the delisting date being set in Information window's Delisting date selector at the bottom.

To find out which type a variable does return either use debugger or use typeof().

printf( "Type of delisting variable: %s", typeof(delisting) );

In EOD interval it means flag last bar and last day (well, and in week, month, year intervals it means last week, month, year as well as last bar) of symbol's array. In intraday intervals it means flag last bar of last day (of last week of last month of last year) of symbol's array.

Yes, cond is an array variable. Datetime() function is type array too. What is datetime? Read about it here https://www.amibroker.com/guide/afl/datetime.html

The condition variable cond means that if there is no delisting date value to be found in Information window then assign 1 (or true) to cond variable else (if there is delisting date being set there in Information window) then set cond variable to true as long as any datetime of array is earlier than delisting date (else it is set to zero -> false).


Hello Fxshrat.

Thanks a lot for your answer!!! :blush: