In the context of investment analysis, we formulate an abstract online comp
uting problem called a planning game and develop general tools for solving
such a game. We then use the tools to investigate a practical buy-and-hold
trading problem faced by long-term investors in stocks. We obtain the uniqu
e optimal static online algorithm for the problem and determine its exact c
ompetitive ratio. We also compare this algorithm with the popular dollar av
eraging strategy using actual market data.