extern bool ClosePosAllEndOfDay = true;
if(ClosePosAllEndOfDay==true && Hour()>=close_pos_hour && Minute()>=close_pos_min){ ... }