In this paper, we consider online (sequential) portfolio selection in a competitive algorithm framework. We construct a sequential algorithm for portfolio investment that asymptotically achieves the wealth of the best piecewise constant rebalanced portfolio tuned to the underlying individual sequence of price relative vectors. Without knowledge of the investment duration, the algorithm can perform as well as the best investment algorithm that can choose both the partitioning of the sequence of the price relative vectors as well as the best constant rebalanced portfolio within each segment based on knowledge of the sequence of price relative vectors in advance. We use a transition diagram similar to that in  to compete with an exponential number of switching investment strategies, using only linear complexity in the data length for combination. The regret with respect to the best piecewise constant strategy is at most O(ln(n)) in the exponent, where n is the investment duration. This method is also extended in  to switching among a finite collection of candidate algorithms, including the case where such transitions are represented by an arbitrary side-information sequence.