This study predicts overvalued or undervalued market ex ante. Based on the arguments of price reversion and momentum in the stock market, the study forms and tests a market timing strategy in managing retirement funds. It provides a simple algorithm for automated trade, which is able to provide performance consistently surpassing the overall stock market in the long run.