Returns the date of the current bar in the YYYYMMDD format. This date corresponds to the day whose trading session contains the current bar. Note that on intraday charts, this date and the actual date might not be the same for Forex and Futures symbols.


declare lower;
input endDate = 20100101;
def cond = GetYYYYMMDD() < endDate;
plot Price = if cond then close else Double.NaN;

This example plots closing price only when the date of the current bar is less than the one specified in the endDate input.