Application of the trend filtering algorithm to the MACHO database