In the one-way trading problem, we are asked to convert dollars into yen only by unidirectional conversions, while watching the exchange rate that fluctuates along time. The goal is to maximize the amount of yen we finally get, under the assumption that we are not informed of when the game ends. For this problem, an optimal algorithm was proposed by El-Yaniv et al. In this paper we formulate this problem into a linear optimization problem (linear program) and reduce derivation of an optimal algorithm to solving the linear optimization problem. This reveals that the optimality of the algorithm follows from the duality theorem. Our analysis demonstrates how infinite-dimensional linear optimization helps to design algorithms.