You can use daily bars and the tdm() and tom() functions for determining the close of the last trading day of a month.